What is the difference between DDL, DML and DCL?
Data Definition Language (DDL)There are called data definition cause they define the data
- Create - creates objects in the database
- Alter - alters objects in the database
- Drop - deletes objects in the database
- Truncate - deletes all records from the table along with the space
- Rename - renames objects in the database
Data Manipulation Language (DML)These are used for data manipulation
- Select - selects records from the table
- Insert - create a new record in the table
- Update - updates the records in the table
- Delete - deletes all the records in the table, but the space remains
- Lock Table - locks a table for controlling data concurrency
Data Control Language (DCL)This is used to control the data, that the data that can be accessed by the user based on his privilege
- Grant - grants users access to the database
- Revoke - removes the access of the user to the database
Transaction Control Language (TCL)
This is used to control the changes done by the DML statemets
- Commit - committing the transaction to the database
- Rollback - rollback is used to revert back the transaction until the last commit
- SavePoint - identify a point in a transaction to which you can later roll back
- Set Transaction - change transaction options like isolation level and what rollback segment to use
Comments
Post a Comment