CREATE [GLOBAL TEMPORARY] TABLE tablename
[EXTERNAL [FILE] 'filespec']
(<col_def> [, <col_def> | <tconstraint> ...])
[ON COMMIT {DELETE | PRESERVE} ROWS]
[SQL SECURITY {DEFINER | INVOKER}]
[{ENABLE | DISABLE} PUBLICATION]
<col_def> ::=
<regular_col_def>
| <computed_col_def>
| <identity_col_def>
<regular_col_def> ::=
colname { <datatype> | domain_name }
[DEFAULT {<literal> | NULL | <context_var>}]
[NOT NULL]
[<col_constraint>]
[COLLATE collation_name]
<computed_col_def> ::=
colname [{ <datatype> | domain_name }]
{COMPUTED [BY] | GENERATED ALWAYS AS} (<expression>)
<identity_col_def> ::=
colname [<datatype>]
GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY [(<identity column options>)]
[<col_constraint>]
<identity column options> ::=
<identity column option> [<identity column option>]
<identity column option> ::=
START WITH startvalue
| INCREMENT [BY] incrementvalue
<datatype> ::=
<scalar_datatype> | <blob_datatype> | <array_datatype>
<scalar_datatype> ::= См. Синтаксис скалярных типов данных
<blob_datatype> ::= См. Синтаксис типа данных BLOB
<array_datatype> ::= См. Синтаксис массивов
<col_constraint> ::= [CONSTRAINT constr_name]
{ UNIQUE [<using_index>]
| PRIMARY KEY [<using_index>]
| REFERENCES other_table [(other_col)]
[ON DELETE { NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
[ON UPDATE { NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
[<using_index>]
| CHECK (<check_condition>)
}
<tconstraint> ::= [CONSTRAINT constr_name]
{ UNIQUE (<col_list>) [<using_index>]
| PRIMARY KEY (<col_list>) [<using_index>]
| FOREIGN KEY (<col_list>)
REFERENCES other_table [(<col_list>)]
[ON DELETE { NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
[ON UPDATE { NO ACTION | CASCADE | SET DEFAULT | SET NULL}]
[<using_index>]
| 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 <val>
| <val> IS [NOT] {TRUE | FALSE | UNKNOWN}
| <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> ::=
<datatype>
| [TYPE OF] domain_name
| TYPE OF COLUMN rel.colname