Sample SQL Statements

Note: Text inside [ ] is optional.  Text inside < > should be replaced.

 INSERT INTO < table_name>

    [ ( < column_list> ) ]

    VALUES ( <expression>  [ ,... n] )

Examples:

DELETE FROM  < table_name>

    [ WHERE < search_condition> ]

Examples:

UPDATE  < table_name>

    SET < column_name> = <expression>  [ ,... n ]

    [ WHERE  < search_condition> ]

Examples:

 

SELECT [< select_list> | DISTINCT ]

    [ FROM < table_source> [ ,... n ] ]

    [ WHERE < search_condition> ]

    [ GROUP BY [ ALL ] < group_by_expression> [ ,... n ] ]

    [ ORDER BY < order_by_expression> [ ASC | DESC ] [ ,... n ] ]

Examples: