What is the difference between TRUNCATE and DROP statements?

 What is the difference between TRUNCATE and DROP statements?

Last updated:9/22/2021 1:22:03 AM

1 Answers

Ashutosh Kumar Verma
Ashutosh Kumar Verma

Different between TRUNCATE and DROP command:

    SQL TRUNCATE Command:

    SQL Truncate command is used to permanently delete only records from a database table. to deleted records by using of truncate command can not be recovered or rollback because it is not stored in cache of the system.

        What is the difference between TRUNCATE and DROP statements?

The following SQL statement is delete records from above table using of Truncate command.

     What is the difference between TRUNCATE and DROP statements?

SQL DROP Command:

    The SQL DROP command is used to delete whole table with records or used to delete a database.

The following SQL statement used to drop the table 'TeacherDetails'

        What is the difference between TRUNCATE and DROP statements?

To drop the database you should use the following SQL command

drop database_name ;


Answer