What is the difference Delete between Truncate ?

Forums SQLWhat is the difference Delete between Truncate ?
Staff asked 2 years ago

Answers (1)

Add Answer
Umang Ramani Marked As Accepted
Staff answered 2 years ago

DELETE:
DELETE is a DML (Data Manipulation Language) command that is used to remove or delete a row (tuple) from a table or relation. A WHERE clause can be included in the DELETE command. When the WHERE clause is used in conjunction with the DELETE command, it removes or deletes just those rows (tuples) that fulfil the condition; otherwise, it eliminates all tuples (rows) from the table. Keep in mind that DELETE records row removals.

TRUNCATE:
TRUNCATE is a DDL (Data Definition Language) command that deletes all rows or tuples from a table. The TRUNCATE command, unlike the DELETE command, does not have a WHERE clause. The transaction log for each destroyed data page is not recorded when using the TRUNCATE command. The TRUNCATE command is faster than the DELETE command. We are unable to restore the data after executing the TRUNCATE command.

Subscribe

Select Categories