5BCA Oracle
Difference between DELETE and TRUNCATE
1.DELETE :
DELETE is a DML(Data Manipulation Language) command and is used when we specify the row(tuple) that we want to remove or delete from the table or relation. The DELETE command can contain a WHERE clause. If WHERE clause is used with DELETE command then it remove or delete only those rows(tuple) that satisfy the condition otherwise by default it removes all the tuples(rows) from the table.
Syntax of DELETE command :
DELETE FROM TableName
WHERE condition;
2.TRUNCATE :
TRUNCATE is a DDL(Data Definition Language) command and is used to delete all the rows or tuples from a table. Unlike the DELETE command, TRUNCATE command does not contain a WHERE clause. In the TRUNCATE command, the transaction log for each deleted data page is recorded. Unlike the DELETE command, the TRUNCATE command is fast and we can’t rollback the data after using the TRUNCATE command.
Syntax of TRUNCATE command:-
TRUNCATE TABLE TableName
On this page of the site you can watch the video online difference delete and truncate command with a duration of hours minute second in good quality, which was uploaded by the user SICS Chitrakoot 21 August 2020, share the link with friends and acquaintances, this video has already been watched 70 times on youtube and it was liked by 2 viewers. Enjoy your viewing!