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
What is the difference between having and where clause in mysql? Explain
What is a scalar function?
Which storage engine is best in mysql?
How many rows can mysql hold?
Why do you think it is advised to not to use guid and character columns as clustered index arrays?
How many triggers are possible in mysql?
What is delimiter $$?
How to write after insert event update trigger on the same table in mysql?
Is mysql a server?
How do I clear the command in mysql?
What does mysql flush hosts do?
How many primary keys can be there in a table?
What are the advantages of MySQL when compared with Oracle?
How do I change directories in mysql?
How do I find mysql database?