DDL, DML, DCL and TCL are categories of SQL commands that define database structure, modify stored data, manage user permissions and control database transactions.
DDL (Data Definition Language): DDL commands create, alter and delete database structures such as tables, schemas and indexes.
CREATE: Builds new tables, databases, views or indexes.ALTER: Modifies existing structures, such as adding or changing columns.DROP: Deletes database objects and their data.TRUNCATE: Removes all rows from a table while keeping its structure.RENAME: Renames an existing database object.
DML (Data Manipulation Language): DML commands insert, update and delete data inside database tables.
INSERT: Adds new rows into a table.UPDATE: Modifies existing row values.DELETE: Removes specific rows from a table.SELECT: Retrieves data from tables (often classified as DQL).
DCL (Data Control Language): DCL commands manage user access, privileges and security permissions on database objects.
GRANT: Gives specific permissions (likeSELECTorINSERT) to users or roles.REVOKE: Removes previously granted permissions.
TCL (Transaction Control Language): TCL commands manage transactions to keep data consistent.
COMMIT: Permanently saves changes made during a transaction.ROLLBACK: Reverts uncommitted changes back to the last commit or savepoint.SAVEPOINT: Sets a marker within a transaction for partial rollbacks.
Loading…