What is the difference Delete between Truncate ?
Answers (1)
Add AnswerDELETE:
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.