Skip to content
Rene Saarsoo edited this page Aug 4, 2022 · 6 revisions

SQL standard specifies the following CREATE TABLE syntax:

CREATE [{GLOBAL | LOCAL} TEMPORARY] TABLE

Dialects have considerable variation:

BigQuery:

CREATE [OR REPLACE] [TEMP | TEMPORARY | SNAPSHOT | EXTERNAL] TABLE [IF NOT EXISTS]

DB2:

CREATE [GLOBAL TEMPORARY] TABLE

Hive:

CREATE [TEMPORARY] [EXTERNAL] TABLE [IF NOT EXISTS]

MariaDB:

CREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS]

MySQL:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS]

N1QL:

No support for CREATE TABLE.

PL/SQL:

CREATE [table_type] TABLE

table_type:
    {GLOBAL | PRIVATE} TEMPORARY
  | SHARDED
  | DUPLICATED
  | [IMMUTABLE] BLOCKCHAIN
  | IMMUTABLE

PostgreSQL:

CREATE [[GLOBAL | LOCAL] {TEMPORARY | TEMP} | UNLOGGED] TABLE [IF NOT EXISTS]

Redshift:

CREATE [[LOCAL] {TEMPORARY | TEMP}] TABLE [IF NOT EXISTS]

Spark:

CREATE [EXTERNAL] TABLE [IF NOT EXISTS]

SQLite:

CREATE [TEMPORARY | TEMP] TABLE [IF NOT EXISTS]

Transact-SQL:

CREATE TABLE

Trino:

CREATE TABLE [IF NOT EXISTS]
Clone this wiki locally