DROP TABLE is a Data Definition Language (DDL) command that deletes the specified table or list of tables from the schema, including all rows, indexes, constraints, and permission grants attached to those tables. Once executed, the operation is irreversible inside most databases unless it is issued inside a transaction that is later rolled back or the database supports a FLASHBACK-style feature. Some dialects offer safety switches such as IF EXISTS to avoid errors when the table is missing and CASCADE or RESTRICT to control how dependent objects (views, foreign keys, materialized views) are handled. Because it alters the catalog, DROP TABLE requires elevated privileges, typically the table owner or a database administrator.
IF EXISTS
(keyword) - Optional flag that suppresses an error when the table does not exist.table_name
(identifier) - One or more table names to drop, separated by commas.CASCADE
(keyword) - Automatically drop objects that depend on the table (views, foreign keys, triggers).RESTRICT
(keyword) - Refuse to drop the table if any dependent objects exist (default in many systems).CREATE TABLE, ALTER TABLE, DROP VIEW, TRUNCATE TABLE, DROP DATABASE
SQL-92
Yes. DROP TABLE removes the entire table definition and its data. The operation cannot be undone unless you roll back an open transaction or restore from backup.
In most databases, no. After a DROP TABLE is committed, recovery requires a backup restore or special flashback features offered by some enterprise systems.
DROP TABLE deletes the table structure and data. TRUNCATE TABLE quickly removes all rows but keeps the table definition, so you can still insert into it afterward.
Add the IF EXISTS clause: `DROP TABLE IF EXISTS table_name;` This prevents errors when the table is not present.