What are the differences between drop a table and truncate
a table?
Answer Posted / soumik
1.DELETE table will result into deletion of data from the
table without affecting the table structure. But since
delete statement is a DML(Data Manipulation Language)
statement, it directly dosnt reflect the database. In other
words, the deleted data will be stored in a separate
tablespace called UNDO tablespace(which takes up memory)
that can be retrieved by using a ROLLBACK statement.
2. DROP table results into loss of data and structure both
which cannot be retrieved. Drop statement is DDL(Data
Definition Language) which is AUTO-COMMIT.
3. TRUNCATE table will clear the data from the table only
without affecting the table structure. Data cannot be
retrieved after executing this statement as well, since it
an AUTO-COMMIT statement. Truncate is also a DDL statement.
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
What is mysqli_free_result?
What is pragma serially_reusable and why is it used?
How to Change a users password from MySQL prompt. Login as root. Set the password. Update privs.
How do I kill a mysql connection?
How do I grant privileges to a user in mysql phpmyadmin?
What is difference between mysql and mariadb?
How can you calculate the sum of any column of a table?
What is difference between pdo and mysqli?
What causes mysql too many connections?
What is general log in mysql?
Why use mysql procedures?
How to create trigger in mysql workbench?
What is field in mysql?
What is use of mysql?
How to shut down the server with 'mysqladmin'?