What are the differences between drop a table and truncate
a table?

Answer Posted / guru

1.DELETE:
- delete space allocated by mysql server and the structure of table remains same.
- used by either 'WHERE' clause or without it in mysql.
- data can be roll backed
2.TRUNCATE:
- Remove rows from mysql table but the structure of table remains same.
- The data cannot be roll backed
- can be used by only without 'WHERE' clause in mysql.
3. DROP:
- Remove whole table from mysql database.
- The data cannot be roll backed

For more details visit: http://www.phponwebsites.com/2014/01/mysql-delete-truncate-drop-difference.html

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of indexes are there in mysql?

555


What is the use of mysqli_fetch_assoc?

565


What is not null in mysql?

610


How do I setup a mysql database?

556


What is orm in mysql?

560






Can mysql store files?

577


Where is the mysql config file?

551


How can you export the table as an xml file in mysql?

582


How to delete a table.

590


How do I automate a backup in mysql?

550


What is difference between oracle sql and mysql?

573


What is key in mysql?

581


How to calculate expressions with sql statements?

574


What do you mean by % and _ in the LIKE statement?

614


What is select query in mysql?

554