Defines the column names, column data types and attributes, primary and secondary indexes, column- and table-constraints, partitioning, and other attributes of a new table. The CREATE TABLE AS form copies column definitions to a new table. Optionally, data and statistics are copied to the new table.
The table structure definition is stored in the data dictionary for all table types, except volatile tables. While processing a CREATE TABLE statement, an EXCLUSIVE lock is placed on the table being created.
For information about global temporary trace tables, see CREATE GLOBAL TEMPORARY TRACE TABLE.
To create queue tables, see CREATE TABLE (Queue Table Form).
To log batch insert and update errors, you must create an error table for each data table for which you want to track errors. See CREATE ERROR TABLE.
For information about temporal tables and temporal syntax, see Teradata Vantage™ - ANSI Temporal Table Support , B035-1186 and Teradata Vantage™ - Temporal Table Support , B035-1182 .
For information on creating time series tables with a Primary Time Index (PTI), see Teradata Vantage™ - Time Series Tables and Operations, B035-1208.
ANSI Compliance
CREATE TABLE is ANSI SQL:2011-compliant with extensions.
Global temporary tables are ANSI SQL:2011-compliant.
Other SQL dialects support similar non-ANSI standard statements with names such as the following.
- DECLARE GLOBAL TEMPORARY TABLE
- CREATE TEMP TABLE
Volatile tables are a Teradata extension to the ANSI SQL:2011 standard.
Other SQL dialects support similar non-ANSI standard statements with names such as the following:
- DECLARE GLOBAL TEMPORARY TABLE
Required Privileges
No privileges are required to create, access, modify, or drop volatile tables. For all other table types, you must have the CREATE TABLE privilege on the database or user in which the table is created.
If you specify the JOURNAL option, then you must also have INSERT privilege on the journal table.
- UDTUSAGE on the specified UDT
- UDTUSAGE on the SYSUDTLIB database
- UDTTYPE on the SYSUDTLIB database
- UDTMETHOD on the SYSUDTLIB database
You must have the CONSTRAINT ASSIGNMENT privilege to create a table that includes one or more row-level security columns.
Privileges Granted Automatically
No privileges are granted on newly created volatile tables, because no privileges are needed to access the table.
- CREATE TRIGGER
- DELETE
- DROP TABLE
- DROP TRIGGER
- DUMP
- INDEX
- INSERT
- REFERENCES
- RESTORE
- SELECT
- STATISTICS
- UPDATE