SQL DROP TABLE

SQL DROP TABLE

The DROP TABLE statement is used to permanently delete a table from the database.

Warning: Be very careful with this command. Dropping a table deletes the table's structure, all of its data, and any associated indexes, triggers, and constraints. This action is irreversible.


Syntax

DROP TABLE table_name;

TRUNCATE TABLE

If you only want to delete the data inside the table, but not the table itself, you can use the TRUNCATE TABLE statement.

TRUNCATE TABLE is faster than DELETE FROM table_name and usually cannot be rolled back.

TRUNCATE TABLE Syntax

TRUNCATE TABLE table_name;