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


Please Help Members By Posting Answers For Below Questions

What is data in mysql?

666


Is primary key auto increment?

709


how you will Create a database on the mysql server with unix shell.

757


What are the advantages of mysql in comparison to oracle?

766


What is the function of mysqldump?

785


Can mysql function return a table?

844


Which is better sqlite or mysql?

721


Which is faster innodb or myisam?

730


What is data directory in mysql?

667


How do you create a table in mysql workbench?

659


What is the full form of mysql?

751


How to do login in mysql with unix shell.

730


What is the difference between a heap table and temporary table?

693


How can I connect mysql database?

675


Is mysql written in c?

662