CREATE [GLOBAL TEMPORARY] TABLE tablename
[EXTERNAL [FILE] 'filespec']
(<col_def> [, {<col_def> | <tconstraint>} ...])
[{<table_attrs> | <gtt_table_attrs>}]
<col_def> ::=
<regular_col_def>
| <computed_col_def>
| <identity_col_def>
<regular_col_def> ::=
colname {<datatype> | domainname}
[DEFAULT {<literal> | NULL | <context_var>}]
[<col_constraint> ...]
[COLLATE collation_name]
<computed_col_def> ::=
colname [{<datatype> | domainname}]
{COMPUTED [BY] | GENERATED ALWAYS AS} (<expression>)
<identity_col_def> ::=
colname {<datatype> | domainname}
GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY
[(<identity_col_option>...)]
[<col_constraint> ...]
<identity_col_option> ::=
START WITH start_value
| INCREMENT [BY] inc_value
<datatype> ::=
<scalar_datatype> | <blob_datatype> | <array_datatype>
<scalar_datatype> ::=
!! See Scalar Data Types Syntax !!
<blob_datatype> ::=
!! See BLOB Data Types Syntax !!
<array_datatype> ::=
!! See Array Data Types Syntax !!
<col_constraint> ::=
[CONSTRAINT constr_name]
{ PRIMARY KEY [<using_index>]
| UNIQUE [<using_index>]
| REFERENCES other_table [(colname)] [<using_index>]
[ON DELETE {NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
[ON UPDATE {NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
| CHECK (<check_condition>)
| NOT NULL }
<tconstraint> ::=
[CONSTRAINT constr_name]
{ PRIMARY KEY (<col_list>) [<using_index>]
| UNIQUE (<col_list>) [<using_index>]
| FOREIGN KEY (<col_list>)
REFERENCES other_table [(<col_list>)] [<using_index>]
[ON DELETE {NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
[ON UPDATE {NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
| CHECK (<check_condition>) }
<col_list> ::= colname [, colname ...]
<using_index> ::= USING
[ASC[ENDING] | DESC[ENDING]] INDEX indexname
<check_condition> ::=
<val> <operator> <val>
| <val> [NOT] BETWEEN <val> AND <val>
| <val> [NOT] IN (<val> [, <val> ...] | <select_list>)
| <val> IS [NOT] NULL
| <val> IS [NOT] DISTINCT FROM <val>
| <val> [NOT] CONTAINING <val>
| <val> [NOT] STARTING [WITH] <val>
| <val> [NOT] LIKE <val> [ESCAPE <val>]
| <val> [NOT] SIMILAR TO <val> [ESCAPE <val>]
| <val> <operator> {ALL | SOME | ANY} (<select_list>)
| [NOT] EXISTS (<select_expr>)
| [NOT] SINGULAR (<select_expr>)
| (<check_condition>)
| NOT <check_condition>
| <check_condition> OR <check_condition>
| <check_condition> AND <check_condition>
<operator> ::=
<> | != | ^= | ~= | = | < | > | <= | >=
| !< | ^< | ~< | !> | ^> | ~>
<val> ::=
colname ['['array_idx [, array_idx ...]']']
| <literal>
| <context_var>
| <expression>
| NULL
| NEXT VALUE FOR genname
| GEN_ID(genname, <val>)
| CAST(<val> AS <cast_type>)
| (<select_one>)
| func([<val> [, <val> ...]])
<cast_type> ::= <domain_or_non_array_type> | <array_datatype>
<domain_or_non_array_type> ::=
!! See Scalar Data Types Syntax !!
<table_attrs> ::= <table_attr> [<table_attr> ...]
<table_attr> ::=
<sql_security>
| {ENABLE | DISABLE} PUBLICATION
<sql_security> ::= SQL SECURITY {INVOKER | DEFINER}
<gtt_table_attrs> ::= <gtt_table_attr> [gtt_table_attr> ...]
<gtt_table_attr> ::=
<sql_security>
| ON COMMIT {DELETE | PRESERVE} ROWS