What is the difference between DELETE and TRUNCATE commands?
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 2 )
1) Delete
– Delete is Data Manipulation Language command
-You can specify the tuple that you want to delete.
-DELETE command can have WHERE clause.
– DELETE command eliminate the tuples one-by-one.
– DELETE command acts slower as compared to TRUNCATE.
– DELETE command can be followed either by COMMIT or ROLLBACK.
2) Truncate
– Truncate is a Data Definition Language Command
– It deletes all the tuples from a relation.
– TRUNCATE command do not have WHERE clause.
– TRUNCATE delete the entire data page containing the tuples.
– TRUNCATE is faster as compared to DELETE.
– TRUNCATE command can’t be ROLL BACKED.
-Delete
It removes data Plus Table definition or table structure
-Truncate
It only removes data from table