DDL / DML / DCL / TCL / DQL Commands in SQL Server

DML – Data Manipulation Language

They are SQL statements which works with Data in a database. Using them you can insert, retrieve, store, delete, modify and update data.
Example : INSERT, UPDATE, DELETE statements

INSERT – Insert data into table
UPDATE – Modify existing records
DELETE – Delete records from table

DDL – Data Definition Language

These statements works with the structure of database objects like tables or schemas. Using them you can Create, Modify or Drop table, database or schema.
Examples: CREATE, ALTER, DROP statements

CREATE – Create new Database, Table or Schema
ALTER – Modify existing table by adding, deleting, renaming or modifying column definition
DROP – Delete existing Database, Table or Schema




DCL – Data Control Language

These statements are used to control access to database by creating roles, granting them permissions or withdrawing users access privileges.
Example : GRANT, REVOKE

GRANT – Giving permission to users for certain database objects
REVOKE – Removing / withdrawing permissions from users which are previously granted.

TCL – Transaction Control Language

These are the statements which are used to control/ manage the Transactions in a database
Example : COMMIT, ROLLBACK, SAVEPOINT, SET TRANSACTION

SET TRANSACTION – set the behaviour or characteristics of a transaction
COMMIT – Ensure that the statements from start till this point is
ROLLBACK – Undo all changes if any error occurs in a Transaction
SAVEPOINT – A named point within a Transaction, helpful when only a part of transaction needs to rollback.

DQL – Data Query Language

These statements are used to Query data from database.
Example : SELECT

SELECT – Retrieve data from database.