What are DDL, DML, DCL and TCL? How do DELETE, TRUNCATE and DROP differ?
Short answer
SQL has groups: DDL (table structure), DML (data), DCL (permissions), TCL (transactions). DELETE removes row by row, TRUNCATE empties the data but keeps the table, DROP removes the whole table.
3 points to say:
TRUNCATEis DDL and fast.DELETEhasWHEREand fires triggers.- Delete large volumes in batches.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.