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
Is pdo faster than mysqli?
How does limit work in mysql?
What is a simple query?
How do I stop a query in mysql workbench?
Explain about reporting services of MYSQL?
What is sqlyog?
How many mysql connections can handle?
How do I restart mysql on windows?
How can we change the data type of a column of a table?
How to create a table index in mysql?
How to create and drop view in mysql?
Who owns mysql database?
HOW TO FIND display the total number of weeks in the year of 1998 IN EMP TABLE
How do you determine the location of mysql data directory?
How triggers can be used in mysql?