Explain the difference between a DELETE command and TRUNCATE command.

PHOTO EMBED

Tue Nov 28 2023 16:59:38 GMT+0000 (Coordinated Universal Time)

Saved by @nistha_jnn

Diff between TRUNCATE and DELETE command
The DELETE command is used to delete particular records from a table.
The TRUNCATE command is used to delete the complete data from the table.
delete is a DML command.
Truncate is a DDL command
delete works with the WHERE clause.
Truncate not works with where clause
Example: DELETE FROM employee WHERE emp_id = 2012;
Example: TRUNCATE TABLE employee_temp
content_copyCOPY