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 data in mysql?
Is primary key auto increment?
how you will Create a database on the mysql server with unix shell.
What are the advantages of mysql in comparison to oracle?
What is the function of mysqldump?
Can mysql function return a table?
Which is better sqlite or mysql?
Which is faster innodb or myisam?
What is data directory in mysql?
How do you create a table in mysql workbench?
What is the full form of mysql?
How to do login in mysql with unix shell.
What is the difference between a heap table and temporary table?
How can I connect mysql database?
Is mysql written in c?