SQL statements are divided into two major categories: data definition language (DDL) and data manipulation language (DML).
Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
• Create – to create objects in the database
• Alter – alters the structure of the database
• Drop – delete objects from the database
• Truncate – remove all records from a table, including all spaces allocated for the records are removed
• Comment – add comments to the data dictionary
• Rename – rename an object
Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
• Select – retrieve data from the a database
• Insert – insert data into a table
• Update – updates existing data within a table
• Delete – deletes all records from a table, the space for the records remain
• Merge – Upset operation (insert or update)
• Call – call a PL/SQL or Java subprogram
• Explain Plan – explain access path to data
• Lock Table – control concurrency
Data Control Language (DCL) statements. Some examples:
• Grant – gives user’s access privileges to database
• Revoke – withdraw access privileges given with the GRANT command
Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
• Commit – save work done
• Save-point – identify a point in a transaction to which you can later roll back.
• Rollback – restore database to original since the last Commit.
• Set Transaction – Change transaction options like isolation level and what rollback segment to use