SlideShare une entreprise Scribd logo
1  sur  33
[object Object]
MySQL is currently the most popular o pen source  database server in existence.  MY SQL
[object Object],SELECT * FROM table; Where  'SELECT',  'FROM' and  'table'  are in  English,   but  '*'  is a  symbol  that means all.
USES: ,[object Object]
Its popularity for use with web applications is  closely tied to the popularity of  PHP , which is  often combined with MySQL.
Several  high-traffic web sites  includes: ,[object Object]
Facebook,
Wikipedia,
Google,
Nokia and
YouTube  use  MySQL  for data storage and logging of user data.
[object Object]
SELECT  Command - is used to  retrieve  data from  the database.
DELETE  Command - is used to  delete  data from t  the database. . BASIC QUERIES COMMANDS
[object Object]
UPDATE  Command - is used to  update  the data in a table.
DROP  Command - is used to  delete or drop  the database/table.
[object Object],The Create command is used to create a table by specifying the tablename, fieldnames and constraints. Syntax: $createSQL=("CREATE TABLE tblName");
[object Object],  It is used to select the records from a table using its field names. To select all the fields in a table, '*' is used in the command. Syntax: $selectSQL=("SELECT field_names FROM tablename");
[object Object],  The Delete command is used to delete the records from a table using conditions as shown below: Syntax: $deleteSQL=("DELETE * FROM tablename WHERE condition");
[object Object],It is used to insert records into a table. The values are assigned to the field names as shown below: Syntax : $insertSQL=("INSERT INTO tblname(fieldname1,fieldname2..) VALUES(value1,value2,...) ");
[object Object],It is used to update the field values using conditions. This is done using 'SET' and the fieldnames to assign new values to them. Syntax: $updateSQL=("UPDATE Tblname SET (fieldname1=value1,fieldname2=value2,...) WHERE fldstudid=IdNumber");
[object Object],The Drop command is used to delete all the records in a table using the table name as shown below:  Syntax: $dropSQL=("DROP tblName");
Advanced functions and queries that can be useful when building more complex applications. Some of the Advanced queries: *INNER JOIN   *REPLACE *LTRIM,RTRIM  *DATE AND TIME *SIGN  *SQRT *CEILING  *FLOOR ADVANCED QUERIES
[object Object],It is used to retrieve the data from all tables listed based on condition listed after keyword ON.  ,[object Object],The REPLACE function searches a character string and replaces characters found in search string with characters listed in replacement Str.
[object Object],The LTRIM function removes any leading (left-hand) spaces in a character string. ,[object Object],The RTRIM function works like LTRIM, but it removes trailing spaces.
[object Object],The SIGN function takes in a numeric expression and returns the following values based on the sign of the input number: Return Value   Meaning − 1 Input number is negative   0 Input number is zero   1 Input number is positive Null Input number is null
[object Object],  The  SQRT  function takes in a single numeric expression and returns its square root.  ,[object Object],The  CEILING  function returns the smallest integer that is greater than or equal to the value of the numeric expression provided as an input parameter.
[object Object],It returns the integer that is less than or equal to the value of the numeric expression provided as an input parameter.
[object Object]
stored procedures  or functions
whose return values we use in other SQL  statements.
A stored procedure is a procedure (like a  subprogram in a regular computing language)  that is stored (in the database). PROCEDURES

Contenu connexe

Tendances (20)

Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
 
Procedures/functions of rdbms
Procedures/functions of rdbmsProcedures/functions of rdbms
Procedures/functions of rdbms
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
Plsql
PlsqlPlsql
Plsql
 
Basic cursors in oracle
Basic cursors in oracleBasic cursors in oracle
Basic cursors in oracle
 
PL-SQL DIFFERENT PROGRAMS
PL-SQL DIFFERENT PROGRAMSPL-SQL DIFFERENT PROGRAMS
PL-SQL DIFFERENT PROGRAMS
 
Oracle: PLSQL Introduction
Oracle: PLSQL IntroductionOracle: PLSQL Introduction
Oracle: PLSQL Introduction
 
Les22[1]Advanced Explicit Cursor Concepts
Les22[1]Advanced Explicit Cursor ConceptsLes22[1]Advanced Explicit Cursor Concepts
Les22[1]Advanced Explicit Cursor Concepts
 
Oracle: PLSQL
Oracle: PLSQLOracle: PLSQL
Oracle: PLSQL
 
Lab5 sub query
Lab5   sub queryLab5   sub query
Lab5 sub query
 
Oracle: Cursors
Oracle: CursorsOracle: Cursors
Oracle: Cursors
 
PLSQL Tutorial
PLSQL TutorialPLSQL Tutorial
PLSQL Tutorial
 
Functions oracle (pl/sql)
Functions oracle (pl/sql)Functions oracle (pl/sql)
Functions oracle (pl/sql)
 
Les18[1]Interacting with the Oracle Server
Les18[1]Interacting with  the Oracle ServerLes18[1]Interacting with  the Oracle Server
Les18[1]Interacting with the Oracle Server
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 
Les09[1]Manipulating Data
Les09[1]Manipulating DataLes09[1]Manipulating Data
Les09[1]Manipulating Data
 
Les16[1]Declaring Variables
Les16[1]Declaring VariablesLes16[1]Declaring Variables
Les16[1]Declaring Variables
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 
Oracle Baisc Tutorial
Oracle Baisc TutorialOracle Baisc Tutorial
Oracle Baisc Tutorial
 

En vedette (6)

Php1
Php1Php1
Php1
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Zend Server
Zend ServerZend Server
Zend Server
 
Php1
Php1Php1
Php1
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Introducing drupal
Introducing  drupalIntroducing  drupal
Introducing drupal
 

Similaire à MySQL Database Commands (20)

My sql.ppt
My sql.pptMy sql.ppt
My sql.ppt
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
Mysql1
Mysql1Mysql1
Mysql1
 
MYSQL
MYSQLMYSQL
MYSQL
 
Sq lite
Sq liteSq lite
Sq lite
 
Mysql
MysqlMysql
Mysql
 
Database programming
Database programmingDatabase programming
Database programming
 
Oracle notes
Oracle notesOracle notes
Oracle notes
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
Sql Queries
Sql QueriesSql Queries
Sql Queries
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 
sql.pptx
sql.pptxsql.pptx
sql.pptx
 
Unit 2 web technologies
Unit 2 web technologiesUnit 2 web technologies
Unit 2 web technologies
 
Mysql Ppt
Mysql PptMysql Ppt
Mysql Ppt
 
Raj mysql
Raj mysqlRaj mysql
Raj mysql
 
Chapter8 my sql revision tour
Chapter8 my sql revision tourChapter8 my sql revision tour
Chapter8 my sql revision tour
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
 

Dernier

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Dernier (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

MySQL Database Commands

  • 1.
  • 2. MySQL is currently the most popular o pen source database server in existence. MY SQL
  • 3.
  • 4.
  • 5. Its popularity for use with web applications is closely tied to the popularity of PHP , which is often combined with MySQL.
  • 6.
  • 11. YouTube use MySQL for data storage and logging of user data.
  • 12.
  • 13. SELECT Command - is used to retrieve data from the database.
  • 14. DELETE Command - is used to delete data from t the database. . BASIC QUERIES COMMANDS
  • 15.
  • 16. UPDATE Command - is used to update the data in a table.
  • 17. DROP Command - is used to delete or drop the database/table.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. Advanced functions and queries that can be useful when building more complex applications. Some of the Advanced queries: *INNER JOIN *REPLACE *LTRIM,RTRIM *DATE AND TIME *SIGN *SQRT *CEILING *FLOOR ADVANCED QUERIES
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. stored procedures or functions
  • 32. whose return values we use in other SQL statements.
  • 33. A stored procedure is a procedure (like a subprogram in a regular computing language) that is stored (in the database). PROCEDURES
  • 34.
  • 36.
  • 37.
  • 38. proc_parameter : [ IN | OUT | INOUT ] param_name type
  • 39. routine_body : Valid SQL procedure statement
  • 40. An IN parameter is used to pass value into procedure.
  • 41. An INOUT parameter is initialized by the caller and it can be modified by the procedure.
  • 42.
  • 43. We can define simple functions that operate on a single row at a time, or aggregate functions that operate on groups of rows.
  • 44. Information is provided to functions that enables them to check the number, types, and names of the arguments passed to them. FUNCTIONS
  • 45. CREATE FUNCTION Syntax: CREATE FUNCTION func_name ([func_parameter[,...]]) RETURNS type routine_body
  • 46. func_name : Function name func_parameter : param_name type type : Any valid MySQL datatype routine_body : Valid SQL procedure statement The RETURN clause is mandatory for FUNCTION. It used to indicate the return type of function.
  • 47.
  • 48. MySQL IN Clause - used alongwith any MySQL query to specify a condition.
  • 49. MySQL BETWEEN Clause - used to specify a condition.
  • 50.
  • 51. MySQL COUNT Function - used to count the number of rows in a database table.
  • 52. MySQL MAX Function - allows us to select the highest (maximum) value for a certain column.
  • 53.
  • 54. MySQL CONCAT Function - used to concatenate any string inside any MySQL command.
  • 55. MySQL DATE and Time Function - Complete list of MySQL Date and Time related functions.
  • 56.
  • 57. MySQL AVG Function - selects the average value for certain table column.
  • 58. MySQL SUM Function - allows selecting the total for a numeric column.
  • 59. MySQL SQRT Function -generate a square root of a given number.
  • 60.
  • 61. Why Use Stored Procedures and Stored Functions? The real advantage to using stored procedures and stored functions is that they provide functionality which is platform and application independant.
  • 62. It can be used to back up a database or to move database information from one server to another. 1.Export A MySQL Database: It is a good idea to export the data often as a backup. IMPORT AND EXPORT
  • 63. This example shows how to export a database. # mysqldump -u username -ppassword database_name > FILE.sql Replace username, password and database_name with your MySQL username, password and database name.File FILE.sql now holds a backup of your database, download it to your computer.
  • 64. 2. Import A MySQL Database: Here, we import a database. Using this to restore data from a backup or to import from another MySQL server. Start by uploading the FILE.sql file to the server where we will be running this command. # mysql -u username -ppassword database_name < FILE.sql