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 mysql aggregate functions? Explain
Is null in mysql?
How to Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.
How to return query output in xml format?
How can I see all mysql databases?
What are the reasons for selecting lamp (linux, apache, mysql, php) instead of combination of other software programs, servers and operating systems?
How do you create a table in mysql workbench?
How to calculate expressions with sql statements?
How do I backup mysql database on linux?
How do I run mysql without installing?
Can I use mysql for free?
How set mysql root password?
What is difference between unix timestamp and mysql timestamp?
Which is best pdo or mysqli?
What is back end and front end?