What are the differences between DDL, DML and DCL commands?

  • DDL: Data Definition Language (DDL) statements are used to define the database structure or schema.
    • 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
  • DML: Data Manipulation Language (DML) statements are used for managing data within schema objects.
    • 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
    • CALL – Call a PL/SQL or Java subprogram
    • EXPLAIN PLAN – Explain access path to data
    • LOCK TABLE – Control concurrency
  • DCL: Data Control Language (DCL) statements.
    • GRANT – Gives user’s access privileges to database
    • REVOKE – Withdraw access privileges given with the GRANT command
  • TCL: 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
    • SAVEPOINT – 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s