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 striped backup
What is the datatype for password in mysql?
Does mysql case matter?
Can we create table in stored procedure?
If we use sum function in mysql, does it return sum of that row or for that column?
What is the phantom problem?
how you will show all records not containing the name "sonia" and the phone number '9876543210' order by the phone_number field.
What is csv?
How do I rename a mysql database?
How do I show users in mysql?
What is mysql installer?
Can mysql handle billions of records?
In how many ways we can retrieve the data in the result set of MySQL using PHP? What is the difference between mysql_fetch_object and mysql_fetch_array ?
Is mysql relational?
How to load data files into tables with 'mysqlimport'?