DELETE and TRUNCATE in SQL

Why Truncate has been kept as DDL and Delete as DML?

1 Like

Truncate is a Data Definition Language (DDL) command, which means that it is used to define the database structure or schema. Truncate is used to delete all the rows from a table, but unlike Delete, it does not deallocate the space occupied by the rows.

Delete, on the other hand, is a Data Manipulation Language (DML) command, which means that it is used to manipulate the data within the database. Delete is used to remove specific rows from a table based on a condition. It physically removes the rows from the table and deallocates the space occupied by the deleted rows

1 Like