SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot (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
 

Viewers also liked (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
 

Similar to 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
 

Recently uploaded

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 

Recently uploaded (20)

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 

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