- DDL: Data Definition Language, SQL for creating, changing, or deleting database structures.
CREATE: Creates database objects such as tables and indexes.ALTER: Changes the structure of a database object, such as adding a column to an existing table.DROP: Deletes a database object itself, such as a table. Dropping a table also deletes the data it contains.TRUNCATE: Removes all rows while keeping the table structure. You cannot useWHEREto select specific rows to remove.
- DML: Data Manipulation Language, SQL for adding, updating, or deleting data in a database.
INSERT: Adds new rows to a table.UPDATE: Modifies values in existing rows. You can specify which rows to update withWHERE; omitting it targets all rows.DELETE: Deletes rows from a table. You can specify which rows to delete withWHERE; omitting it targets all rows. The table structure is preserved.
- DQL: Data Query Language, SQL for querying data. However,
SELECTis sometimes included in DML.SELECT: Queries data. It can select the columns you need, filter rows by conditions, join multiple tables, or aggregate data.
- SQL (Structured Query Language) is a language for working with database structures and data, and DDL, DML, DQL, and other categories classify SQL commands by purpose.