What is the difference between the DELETE TABLE and TRUNCATE TABLE commands in MySQL?

Answer Posted / hrindows@gmail.com

DELETE TABLE is a logged operation, and every row deleted is logged. Therefore, the process is usually slow.
TRUNCATE TABLE also deletes rows in a table, but it will not log any of the rows deleted. The process is faster here in comparison. TRUNCATE TABLE can be rolled back and is functionally similar to the DELETE statement without a WHERE clause.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is mysql a free database?

485


write a command to view the content of the table

496


What is blob storage?

494


How to drop an existing table in mysql?

551


What is session variable in mysql?

495






can you tell how can you display the maximum salary in sql? : Mysql dba

465


How to create a new table by selecting rows from another table in mysql?

495


Why mysql is so popular?

511


Can you tell the difference between mysql_fetch_object and mysql_fetch_array?

498


What you can use regular expression for in mysql? Support your answer with an example?

479


What are mysql queries?

480


What is normalization and list the different types of normalization?

517


What is mysql uuid?

526


What is dirty read and phantom read?

441


How many triggers are possible in mysql?

508