SlideShare a Scribd company logo
MY SQL MySQL is a relational database management system.The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Sun Microsystems, a subsidiary of Oracle Corporation
Features A broad subset of ANSI SQL 99, as well as extensions Cross-platform support Stored procedures Triggers Cursors Updatable Views True Varchar support SSL support Query caching Sub-SELECTs (i.e. nested SELECTs) Full-text indexing and searching using MyISAM engine Embedded database library Hot backup (via mysqlhotcopy) under certain conditions
Management and Graphical Frontends MySQL is primarily an RDBMS and therefore ships with no GUI tools to administer MySQL databases or manage data contained within. Users may use the included command-line tools, or download MySQL frontends from various parties that have developed desktop software and web applications to manage MySQL databases, build database structure, and work with data reco
MySQL can be built and installed manually from source code, but this can be tedious so it is more commonly installed from a binary package unless special customizations are required. On most Linux distributions the package management system can download and install MySQL with minimal effort, though further configuration is often required to adjust security and optimization settings. It is still most commonly used in small to medium scale single-server deployments, either as a component in a LAMP based web application or as a standalone database server. Much of MySQL's appeal originates in its relative simplicity and ease of use, which is enabled by an ecosystem of open source tools such as phpMyAdmin. USAGE:
MYSQL IN SYSTEM: Inorder to use the mysql we again need the web server package called  'XAMPP ' “ Xampp is a free and open source cross-platform web server package, consisting mainly of the Apache HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl programming languages.” XAMPP requires only one zip, tar or exe file to be downloaded and run, and little or no configuration of the various components that make up the web server is required. XAMPP is regularly updated to incorporate the latest releases of Apache/MySQL/PHP and Perl.
INSTALLATION PROCEDURE Step 1: We need to have the xampp for linux inorder the run applications so(as per step 1) ,download the xampp for linux with any favourable version on to the computer
Step 2: After the successful downloading,we need to extract the 'tar' file on to the system,select a path and just extract them using the following commands gunzip -d httpd-2_0_NN.tar.gz tar xvf httpd-2_0_NN.tar *NN -refers to the current xampp versions
CONFIGURATION
Inorder to configure the ,we need to locate the xampp folder to which it is extracted. After the location of these file we can find the configure file in the 'etc' folder as  “my.cnf”, inside which we can find the configuration file  “ configuration file main Apache HTTP server configuration .  It contains the configuration directives that give the server its instructions”
In this file, you can use all long options that a program supports. If you want to know which options a program supports, run the program with the "--help" option. Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /opt/lampp/var/mysql/mysql.sock skip-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M
To know where all the plugins will be ,then; plugin_dir = /opt/lampp/lib/mysql/plugin/ ------------------------------------------------------------------ We should never prefer tcp/Ip ports,because it will creating a security enhancement,so if all the ports are after a same host then wen need to use the  “named pipes” ,  in windows  enabling this will make mysql useless
Replication Master Server (default) binary logging is required for replication log-bin deactivated by default since XAMP 1.4.11 log-bin=mysql-bin required unique id between 1 and 2^32 - 1defaults to 1 if master-host is not set but will not function as a master if omitted server-id = 1 Replication of master
IMPORTING SQL: Any relational database can be imported into the xampp tool for furthur,this can be done using the  “import”  and we need to browse the ' .sql'  which is to be imported,after selecting it then click on the “go” button and the sql will be imported
EXPORTING SQL: At fist we need to open the xampp for the database query,then after creating the table and inserting the values into the database,[which can be done either in the simplified or ordinary method like writing the sql query by ourself],then clicking the  “EXPORT”  we can save the sql in its format and which can be used in furthur endaveour.
SQL QUERIES
CREATE :  To create an empty database named "employees" on your DBMS. SYNTAX: CREATE TABLE personal_info (first_name char(20) not null, last_name char(20) not null, employee_id int not null) n our example, the table contains three attributes: first_name, last_name and employee_id  DDL COMMANDS:
USE  COMMAND: The USE command allows you to specify the database you wish to work with within your DBMS. For example, if we're currently working in the sales database and want to issue some commands that will affect the employees database, we would preface them with the following SQL command: USE employees It's important to always be conscious of the database you are working in before issuing SQL commands that manipulate data.
ALTER : Once you've created a table within a database, you may wish to modify the definition of it. The ALTER command allows you to make changes to the structure of a table without deleting and recreating it. Take a look at the following command: ALTER TABLE personal_info ADD salary money null This example adds a new attribute to the personal_info table -- an employee's salary. The "money" argument specifies that an employee's salary will be stored using a dollars and cents format. Finally, the "null" keyword tells the database that it's OK for this field to contain no value for any given employee.
DROP : The final command of the Data Definition Language, DROP, allows us to remove entire database objects from our DBMS. For example, if we want to permanently remove the personal_info table that we created, we'd use the following command: DROP TABLE personal_info
INSERT : The INSERT command in SQL is used to add records to an existing table. Returning to the personal_info example from the previous section, let's imagine that our HR department needs to add a new employee to their database. They could use a command similar to the one shown below: INSERT INTO personal_info values('bart','simpson',12345,$45000)
SELECT : The SELECT command is the most commonly used command in SQL. It allows database users to retrieve the specific information they desire from an operational database. Let's take a look at a few examples, again using the personal_info table from our employees database SELECT * from personal_info
UPDATE : The UPDATE command can be used to modify information contained within a table, either in bulk or individually.  UPDATE personal_info SET salary = salary * 1.03
DELETE : The DELETE command with a WHERE clause can be used to remove his record from the personal_info table: DELETE FROM personal_info WHERE employee_id = 12345
DML COMMANDS: Group By: The Group By statement in SQL is used for aggregation, which means that the result that is returned is based on grouping of results based on a column aggregation. SELECT Roll_No, SUM(Marks) FROM t_students WHERE Class = 5 GROUP BY Roll_No
Order By: The Order By clause in SQL is used to set the sequence of the output in terms of being alphabetical, magnitude of size, order of date. It may accompanied by an 'asc' or 'desc' clause so as to specify whether the results are in ascending or descending order. Note: The results of a select query that does not use asc or desc is in ascending order, by default. SELECT fname, lname FROM t_students ORDER BY fname ASC;
BETWEEN: The BETWEEN keyword allows for selecting a range. The syntax for the BETWEEN clause is as follows: SELECT "column_name" FROM "table_name" WHERE "column_name" BETWEEN 'value1' AND 'value2' This will select all rows whose column has a value between 'value1' and 'value2'. UNIQUE: The UNIQUE constraint ensures that all values in a column are distinct. For example, in the following CREATE TABLE statement, CREATE TABLE Customer (SID integer Unique, Last_Name varchar (30), First_Name varchar(30)); Column "SID" has a unique constraint, and hence cannot include duplicate values. Such constraint does not hold for columns "Last_Name" and "First_Name"
S QL has several arithematic functions, and they are: •  AVG: Average of the column. •  COUNT: Number of records. •  MAX: Maximum of the column. •  MIN: Minimum of the column. •  SUM: Sum of the column. The syntax for using functions is, SELECT "function type" ("column_name") FROM "table_name" SQL FUNCTIONS:
 

More Related Content

PPT
PPTX
DATABASE CONSTRAINTS
PPTX
introdution to SQL and SQL functions
PPT
Introduction to structured query language (sql)
PPTX
Structured query language(sql)ppt
PPT
Introduction to sql
DOCX
Keys used in database
PPT
SQL Tutorial - Basic Commands
DATABASE CONSTRAINTS
introdution to SQL and SQL functions
Introduction to structured query language (sql)
Structured query language(sql)ppt
Introduction to sql
Keys used in database
SQL Tutorial - Basic Commands

What's hot (20)

PPTX
Types Of Keys in DBMS
PDF
Relational database- Fundamentals
PPTX
SQL Functions
PPTX
Sql commands
PPTX
SQL Basics
PPT
MySql slides (ppt)
PPT
SQL select statement and functions
PPT
Joins in SQL
PPT
MySQL and its basic commands
PPTX
SQL - Structured query language introduction
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
PPTX
DBMS Keys
PPTX
SQL commands
PPTX
Crear base de datos mysql command
PDF
Create table
PDF
Python Function.pdf
PPTX
Xml namespace
PPT
SQL subquery
PPTX
SQL - DML and DDL Commands
PPTX
Presentation on Relational Schema (Database)
Types Of Keys in DBMS
Relational database- Fundamentals
SQL Functions
Sql commands
SQL Basics
MySql slides (ppt)
SQL select statement and functions
Joins in SQL
MySQL and its basic commands
SQL - Structured query language introduction
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DBMS Keys
SQL commands
Crear base de datos mysql command
Create table
Python Function.pdf
Xml namespace
SQL subquery
SQL - DML and DDL Commands
Presentation on Relational Schema (Database)
Ad

Viewers also liked (15)

PPT
Apache
PDF
Rafeeq Rehman - Breaking the Phishing Attack Chain
PDF
Learn PHP MySQL with Project
PPTX
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
PPT
Maria db the new mysql (Colin Charles)
PDF
CFMA Cyber Crime Presentation
PDF
MySQL Backup & Recovery
PPT
FBI Cybercrime Presentation
PPT
Xampp Ppt
PDF
Spear phishing attacks-by-hari_krishna
PPTX
Introduction to xampp
PPTX
Cybercrime.ppt
PDF
2015 Upload Campaigns Calendar - SlideShare
PPTX
What to Upload to SlideShare
PDF
Getting Started With SlideShare
Apache
Rafeeq Rehman - Breaking the Phishing Attack Chain
Learn PHP MySQL with Project
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
Maria db the new mysql (Colin Charles)
CFMA Cyber Crime Presentation
MySQL Backup & Recovery
FBI Cybercrime Presentation
Xampp Ppt
Spear phishing attacks-by-hari_krishna
Introduction to xampp
Cybercrime.ppt
2015 Upload Campaigns Calendar - SlideShare
What to Upload to SlideShare
Getting Started With SlideShare
Ad

Similar to Mysql (20)

PPT
My sql with querys
PPT
Mysql ppt
ODP
ODP
PPT
Raj mysql
PPT
MYSQL
PPT
SQLMAP Tool Usage - A Heads Up
ODP
Mysqlppt
PPTX
Sqlmap
ODP
MySQL Scaling Presentation
PDF
Complete SQL in one video by shradha.pdf
ODP
My sql
PPTX
Database COMPLETE
PPTX
Using Mysql.pptx
PPT
Prog1 chap1 and chap 2
PDF
Mysql tutorial
PDF
Postgresql quick guide
ODP
My sql Syntax
My sql with querys
Mysql ppt
Raj mysql
MYSQL
SQLMAP Tool Usage - A Heads Up
Mysqlppt
Sqlmap
MySQL Scaling Presentation
Complete SQL in one video by shradha.pdf
My sql
Database COMPLETE
Using Mysql.pptx
Prog1 chap1 and chap 2
Mysql tutorial
Postgresql quick guide
My sql Syntax

More from Rathan Raj (8)

PPTX
Database Normalization
PPTX
Photochemical smog
PPT
Web20
PPT
PPT
PPT
PPT
Linux
PPT
Database Normalization
Photochemical smog
Web20
Linux

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Cloud computing and distributed systems.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Cloud computing and distributed systems.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Mysql

  • 1. MY SQL MySQL is a relational database management system.The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Sun Microsystems, a subsidiary of Oracle Corporation
  • 2. Features A broad subset of ANSI SQL 99, as well as extensions Cross-platform support Stored procedures Triggers Cursors Updatable Views True Varchar support SSL support Query caching Sub-SELECTs (i.e. nested SELECTs) Full-text indexing and searching using MyISAM engine Embedded database library Hot backup (via mysqlhotcopy) under certain conditions
  • 3. Management and Graphical Frontends MySQL is primarily an RDBMS and therefore ships with no GUI tools to administer MySQL databases or manage data contained within. Users may use the included command-line tools, or download MySQL frontends from various parties that have developed desktop software and web applications to manage MySQL databases, build database structure, and work with data reco
  • 4. MySQL can be built and installed manually from source code, but this can be tedious so it is more commonly installed from a binary package unless special customizations are required. On most Linux distributions the package management system can download and install MySQL with minimal effort, though further configuration is often required to adjust security and optimization settings. It is still most commonly used in small to medium scale single-server deployments, either as a component in a LAMP based web application or as a standalone database server. Much of MySQL's appeal originates in its relative simplicity and ease of use, which is enabled by an ecosystem of open source tools such as phpMyAdmin. USAGE:
  • 5. MYSQL IN SYSTEM: Inorder to use the mysql we again need the web server package called 'XAMPP ' “ Xampp is a free and open source cross-platform web server package, consisting mainly of the Apache HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl programming languages.” XAMPP requires only one zip, tar or exe file to be downloaded and run, and little or no configuration of the various components that make up the web server is required. XAMPP is regularly updated to incorporate the latest releases of Apache/MySQL/PHP and Perl.
  • 6. INSTALLATION PROCEDURE Step 1: We need to have the xampp for linux inorder the run applications so(as per step 1) ,download the xampp for linux with any favourable version on to the computer
  • 7. Step 2: After the successful downloading,we need to extract the 'tar' file on to the system,select a path and just extract them using the following commands gunzip -d httpd-2_0_NN.tar.gz tar xvf httpd-2_0_NN.tar *NN -refers to the current xampp versions
  • 9. Inorder to configure the ,we need to locate the xampp folder to which it is extracted. After the location of these file we can find the configure file in the 'etc' folder as “my.cnf”, inside which we can find the configuration file “ configuration file main Apache HTTP server configuration . It contains the configuration directives that give the server its instructions”
  • 10. In this file, you can use all long options that a program supports. If you want to know which options a program supports, run the program with the "--help" option. Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /opt/lampp/var/mysql/mysql.sock skip-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M
  • 11. To know where all the plugins will be ,then; plugin_dir = /opt/lampp/lib/mysql/plugin/ ------------------------------------------------------------------ We should never prefer tcp/Ip ports,because it will creating a security enhancement,so if all the ports are after a same host then wen need to use the “named pipes” , in windows enabling this will make mysql useless
  • 12. Replication Master Server (default) binary logging is required for replication log-bin deactivated by default since XAMP 1.4.11 log-bin=mysql-bin required unique id between 1 and 2^32 - 1defaults to 1 if master-host is not set but will not function as a master if omitted server-id = 1 Replication of master
  • 13. IMPORTING SQL: Any relational database can be imported into the xampp tool for furthur,this can be done using the “import” and we need to browse the ' .sql' which is to be imported,after selecting it then click on the “go” button and the sql will be imported
  • 14. EXPORTING SQL: At fist we need to open the xampp for the database query,then after creating the table and inserting the values into the database,[which can be done either in the simplified or ordinary method like writing the sql query by ourself],then clicking the “EXPORT” we can save the sql in its format and which can be used in furthur endaveour.
  • 16. CREATE : To create an empty database named "employees" on your DBMS. SYNTAX: CREATE TABLE personal_info (first_name char(20) not null, last_name char(20) not null, employee_id int not null) n our example, the table contains three attributes: first_name, last_name and employee_id DDL COMMANDS:
  • 17. USE COMMAND: The USE command allows you to specify the database you wish to work with within your DBMS. For example, if we're currently working in the sales database and want to issue some commands that will affect the employees database, we would preface them with the following SQL command: USE employees It's important to always be conscious of the database you are working in before issuing SQL commands that manipulate data.
  • 18. ALTER : Once you've created a table within a database, you may wish to modify the definition of it. The ALTER command allows you to make changes to the structure of a table without deleting and recreating it. Take a look at the following command: ALTER TABLE personal_info ADD salary money null This example adds a new attribute to the personal_info table -- an employee's salary. The "money" argument specifies that an employee's salary will be stored using a dollars and cents format. Finally, the "null" keyword tells the database that it's OK for this field to contain no value for any given employee.
  • 19. DROP : The final command of the Data Definition Language, DROP, allows us to remove entire database objects from our DBMS. For example, if we want to permanently remove the personal_info table that we created, we'd use the following command: DROP TABLE personal_info
  • 20. INSERT : The INSERT command in SQL is used to add records to an existing table. Returning to the personal_info example from the previous section, let's imagine that our HR department needs to add a new employee to their database. They could use a command similar to the one shown below: INSERT INTO personal_info values('bart','simpson',12345,$45000)
  • 21. SELECT : The SELECT command is the most commonly used command in SQL. It allows database users to retrieve the specific information they desire from an operational database. Let's take a look at a few examples, again using the personal_info table from our employees database SELECT * from personal_info
  • 22. UPDATE : The UPDATE command can be used to modify information contained within a table, either in bulk or individually. UPDATE personal_info SET salary = salary * 1.03
  • 23. DELETE : The DELETE command with a WHERE clause can be used to remove his record from the personal_info table: DELETE FROM personal_info WHERE employee_id = 12345
  • 24. DML COMMANDS: Group By: The Group By statement in SQL is used for aggregation, which means that the result that is returned is based on grouping of results based on a column aggregation. SELECT Roll_No, SUM(Marks) FROM t_students WHERE Class = 5 GROUP BY Roll_No
  • 25. Order By: The Order By clause in SQL is used to set the sequence of the output in terms of being alphabetical, magnitude of size, order of date. It may accompanied by an 'asc' or 'desc' clause so as to specify whether the results are in ascending or descending order. Note: The results of a select query that does not use asc or desc is in ascending order, by default. SELECT fname, lname FROM t_students ORDER BY fname ASC;
  • 26. BETWEEN: The BETWEEN keyword allows for selecting a range. The syntax for the BETWEEN clause is as follows: SELECT "column_name" FROM "table_name" WHERE "column_name" BETWEEN 'value1' AND 'value2' This will select all rows whose column has a value between 'value1' and 'value2'. UNIQUE: The UNIQUE constraint ensures that all values in a column are distinct. For example, in the following CREATE TABLE statement, CREATE TABLE Customer (SID integer Unique, Last_Name varchar (30), First_Name varchar(30)); Column "SID" has a unique constraint, and hence cannot include duplicate values. Such constraint does not hold for columns "Last_Name" and "First_Name"
  • 27. S QL has several arithematic functions, and they are: • AVG: Average of the column. • COUNT: Number of records. • MAX: Maximum of the column. • MIN: Minimum of the column. • SUM: Sum of the column. The syntax for using functions is, SELECT "function type" ("column_name") FROM "table_name" SQL FUNCTIONS:
  • 28.