MySQL + SQL · Lesson 33
SQL Commands: DDL, DML, DQL, DCL and TCL
Categories of SQL Commands
SQL commands are grouped into five categories based on what they do.
The Five Categories
| Category | Full Form | Commands |
|---|---|---|
| DDL | Data Definition | CREATE, ALTER, DROP, TRUNCATE |
| DML | Data Manipulation | INSERT, UPDATE, DELETE |
| DQL | Data Query | SELECT |
| DCL | Data Control | GRANT, REVOKE |
| TCL | Transaction Control | COMMIT, ROLLBACK, SAVEPOINT |
Examples
CREATE TABLE students(roll INT, name VARCHAR(40)); -- DDL
INSERT INTO students VALUES(1,'Aman'); -- DML
SELECT * FROM students; -- DQL
GRANT SELECT ON students TO 'user1'; -- DCL
COMMIT; -- TCL
Summary
- DDL=structure, DML=data changes, DQL=SELECT, DCL=permissions, TCL=transactions.