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

How do I connect to mysql database?

695


What are the technical features of MySQL?

749


How do I start mysql from command line?

710


How to change a password for an existing user via mysqladmin?

734


Is mysql server free?

656


What is a scalar function?

705


What are the differences between binary and varbinary?

700


What are the applications required to support mysql?

665


Does mysql need a server?

666


What are Heap tables?

1122


What is pragma autonomous_transaction?

629


How to display top 10 rows in mysql?

744


How do I create a new database in mysql?

661


What is mysql and how it works?

629


Table - Products has number of products as below Productid ProductName 1 iPhone 2 iPad 3 BlackBerry Table - SalesPersonProduct has the below records Salespersonid productid S1 1 S1 2 S1 3 S2 1 S3 2 Write a SQL query that returns the total number of sold products

2595