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

SQL standard specifies the following CREATE TABLE syntax:

CREATE [{GLOBAL | LOCAL} TEMPORARY] TABLE

https://github.com/sql-formatter-org/sql-formatter/wiki/_new 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]

SingleStoreDB:

CREATE [ROWSTORE] [REFERENCE | TEMPORARY | GLOBAL TEMPORARY] TABLE [IF NOT EXISTS]

Snowflake:

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

table_type:
    [LOCAL | GLOBAL] {TEMP | TEMPORARY}
  | VOLATILE
  | TRANSIENT

Spark:

CREATE [EXTERNAL] TABLE [IF NOT EXISTS]

SQLite:

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

TiDB:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS]

Transact-SQL:

CREATE TABLE

Trino:

CREATE TABLE [IF NOT EXISTS]
Clone this wiki locally