
Asked in Cognizant and 40 others
What is the difference between truncate and delete, and when would you prefer one operation over the other?

AnswerBot
1y
Delete command removes rows one by one while truncate command removes all rows at once.
Delete is a DML command while truncate is a DDL command.
Delete can be rolled back while truncate cannot be rolled...read more
Abhay Sharma
1y
TRUNCATE is a type of DDL command while DELETE is a kind of DML command. One can use TRUNCATE for deleting an entire set of data from a given table while the DELETE command only deletes specific data ...read more
Anonymous
1y
truncate is faster to delete all the rows ( as no log is saved) delete is slower as compared as it works on the specified condition to delete the rows
Anonymous
1y
Delete : it is Dml command, its support where condition, deleted data temporary, retrieve data by using roll back command, its process is slow. Truncate : its ddl cmd, it doesn't support where conditi...read more
Anonymous
2y
TRUNCATE should be used when you need to delete all rows from a table and you do not need to be able to restore the deleted rows. DELETE should be used when you need to delete specific rows from a tab...read more
Add answer anonymously...
Interview Questions from Popular Companies

3.7
• 8.7k Interviews

4.0
• 5.4k Interviews

3.5
• 4.2k Interviews

3.6
• 8k Interviews

3.7
• 6k Interviews

3.7
• 6.1k Interviews

3.5
• 4.2k Interviews

3.7
• 5.1k Interviews
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

