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

What is the maximum number of columns per table?

682


What is 1nf 2nf 3nf?

717


What is blob in mysql?

722


What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?

713


How to create a new table in mysql?

784


How we can create index in mysql?

718


What is the command used to create a database using php and mysql?

862


What is field in mysql?

679


What is the use of i-am-a-dummy flag in mysql?

752


What are the limitations of mysql?

738


What is mysql and how it works?

655


How can I connect mysql database?

675


How does mysql store dates?

699


How to get the number of rows selected or affected by a sql statement?

694


What is an example of a delimiter?

698