SQLBeginner#fundamentals

What are DDL, DML, DQL, DCL and TCL?

DDL defines structure (CREATE, ALTER, DROP, TRUNCATE). DML changes data (INSERT, UPDATE, DELETE). DQL reads data (SELECT). DCL manages permissions (GRANT, REVOKE). TCL controls transactions (COMMIT, ROLLBACK, SAVEPOINT).

Example
ALTER TABLE users ADD phone VARCHAR(15); -- DDL
UPDATE users SET phone = '99999' WHERE id = 1; -- DML
GRANT SELECT ON users TO analyst; -- DCL
ROLLBACK TO SAVEPOINT sp1; -- TCL

Related Questions

1
SQLIntermediate#joins

What is the difference between a natural join and an equi join?

Open
2
SQLBeginner#fundamentals

What is SQL?

Open
3
SQLBeginner#fundamentals

What is the difference between DBMS and RDBMS?

Open