Skip to content
Daniël van Eeden edited this page Mar 13, 2024 · 6 revisions

SQL standard specifies the following DROP TABLE syntax:

DROP TABLE table_name {CASCADE | RESTRICT}

Dialects have considerable variation:

BigQuery:

DROP [EXTERNAL | SNAPSHOT] TABLE [IF EXISTS] table_name

DB2:

DROP TABLE [HIERARCHY] table_name

Hive:

DROP TABLE [IF EXISTS] table_name [PURGE]

MariaDB:

DROP [TEMPORARY] TABLE [IF EXISTS] table_name ["," ...]
  [WAIT n | NOWAIT]
  [RESTRICT | CASCADE]

MySQL:

DROP [TEMPORARY] TABLE [IF EXISTS] table_name ["," ...]
  [RESTRICT | CASCADE]

N1QL:

No support for DROP TABLE.

PL/SQL:

DROP TABLE table_name [CASCADE CONSTRAINTS] [PURGE]

PostgreSQL:

DROP TABLE [IF EXISTS] table_name ["," ...] [CASCADE | RESTRICT]

Redshift:

DROP TABLE [IF EXISTS] table_name ["," ...] [CASCADE | RESTRICT]

SingleStoreDB:

DROP [TEMPORARY] TABLE [IF EXISTS] table_name [FORCE]

Snowflake:

DROP TABLE [IF EXISTS] table_name [CASCADE | RESTRICT]

Spark:

DROP TABLE [IF EXISTS] table_name

SQLite:

DROP TABLE [IF EXISTS] table_name

TiDB:

DROP [TEMPORARY] TABLE [IF EXISTS] table_name ["," ...]
  [RESTRICT | CASCADE]

Transact-SQL:

DROP TABLE [IF EXISTS] table_name ["," ...]

Trino:

DROP TABLE [IF EXISTS] table_name
Clone this wiki locally