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

How do I find mysql database?

480


What is full text indexing in mysql?

469


What is database migration in mysql?

515


What are the different types of triggers in mysql?

453


Can we rename database in mysql?

487






Which is better mysql or microsoft sql?

437


What is sharding in mysql?

507


What is the difference between timestamp and datetime in mysql?

541


What is view in mysql?

525


How do I copy an entire mysql database?

471


What is the datatype for password in mysql?

519


What is the current version of mysql?

477


What is the size of mysql database?

487


suppose data is copie to oracle to sql by using DTS. Actully it taken 2 hours. suppose some day distribute the server in the middle of 2 hours. after how can i get the data ?

1667


What is striped backup

1822