What is the difference between DML and DDL ?

DML (Data Manipulation Language) DDL (Data Definition Language)
DML is abbreviation of Data Manipulation Language. DML statements are used to work with the data in tables. When you are work in multi-user databases, we are in effect of working with a private copy of our tables that can’t be seen by anyone else until we are finished. DDL is abbreviation of Data Definition Language. DDL statements are used to build and modify the structure of table and other object in the database.
DML statements are used to modify the data stored in the tables. These statements are used for managing data within schema objects. DML commands can’t be rollback when a DDL command is executed immediately after a DML. It is used to define the schema of the table. When we execute any DDL statement, it shows its effect immediately.
DML Statements are as follow :

1. SELECT – retrieve data from the a database
2. INSERT – insert data into a table
3. UPDATE – updates existing data within a table
4. DELETE – deletes all records from a table, the space for the records remain
5. MERGE – UPSERT operation (insert or update)
6. CALL – call a PL/SQL or Java subprogram
7. EXPLAIN PLAN – explain access path to data
8. LOCK TABLE – control concurrency

Data definition language (DDL) commands enable us to perform the following tasks:

 

1. Create, alter, and drop schema objects.

2. Grant and revoke privileges and roles

3. Add comments to the data dictionary

 

 

Leave a Reply