KEMBAR78
Sql - Structured Query Language | PPTX
DDL

                 DML


Outline                   History

                What is   SQL  Statement
SQL         Structured Query Language
Special-purpose programming language for
working with sets of facts and the
relationships between them.
                                   DML


                                           SQL
                                    DDL
History        SQL Develop by
                                                    IBM

                        1970s        Donald D.
                                   Chamberlin and
                                    Raymond F.
                                       Boyce




Initial version
           SEQUEL
            (Structured English Query Language)
DDL              Data Definition Language

  CREATE       an object (a table) in the database

                                           TRUNCATE
                                           deletes all data from a table




ALTER   modifies the structure of an existing object
                                                                DROP
                                                                delete an object
Data Manipulation Language    DML
     INSERT
                  Adds rows to an existing table

      UPDATE        Modifies a set of existing table
                    rows
     DELETE
                  Removes existing rows from a
                  table
INSERT
UPDATE
DELETE
Select
 Statement
                                                            Tables
                                                 Data
            What tables contain the data

  How data from different sources is related
                                                        Criteria
Which fields or calculations will produce the data

      Criteria that data must match to be included
                 Whether and how to sort the results

                                               Data Retrieval
Select
Statement
   Basic
SELECT <field>
FROM <table>
WHERE <criterion>;


                       Example
                     SELECT name, address
                     FROM student
                     WHERE stuID=123;

Sql - Structured Query Language

  • 2.
    DDL DML Outline History What is SQL Statement
  • 3.
    SQL Structured Query Language Special-purpose programming language for working with sets of facts and the relationships between them. DML SQL DDL
  • 4.
    History SQL Develop by IBM 1970s Donald D. Chamberlin and Raymond F. Boyce Initial version SEQUEL (Structured English Query Language)
  • 5.
    DDL Data Definition Language CREATE an object (a table) in the database TRUNCATE deletes all data from a table ALTER modifies the structure of an existing object DROP delete an object
  • 6.
    Data Manipulation Language DML INSERT Adds rows to an existing table UPDATE Modifies a set of existing table rows DELETE Removes existing rows from a table
  • 7.
  • 8.
  • 9.
  • 10.
    Select Statement Tables Data What tables contain the data How data from different sources is related Criteria Which fields or calculations will produce the data Criteria that data must match to be included Whether and how to sort the results Data Retrieval
  • 11.
    Select Statement Basic SELECT <field> FROM <table> WHERE <criterion>; Example SELECT name, address FROM student WHERE stuID=123;