CREATE TABLE/CREATE TABLE AS (Temporal Forms) | Teradata Vantage - 17.10 - CREATE TABLE/CREATE TABLE AS Syntax (Temporal Form) - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1182-171K
Language
English (United States)
Teradata Vantage™ - Temporal Table Support describes syntax that is especially relevant to temporal tables. Syntax that is not required, or that is not otherwise specific to temporal tables is generally not shown in this document. For additional syntax, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144 , Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 , and Teradata Vantage™ - SQL Data Control Language, B035-1149.
[NONTEMPORAL] CREATE MULTISET [ GLOBAL TEMPORARY | VOLATILE ] TABLE
  [ database_name. | user_name. ] table_name
  [ , create_table_option [...] ]
  ( other_create_table_option [,...] )
  standard_table_options [;]
For descriptions of standard data types, column attributes, index and partition options, and other standard CREATE TABLE syntax, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
other_create_table_option
{ column_definition |

  derived_period_column |

  table_level_definition |

  NORMALIZE [ ALL BUT ( ignored_column_list ) ]
    ON normalize_column [ ON OVERLAPS [ OR MEETS ] ]
}
column_definition
column_name {

  data_type [ column_attribute | column_constraint_attributes ] [...] |

  temporal_column
}
derived_period_column
PERIOD FOR derived_column ( begin_column, end_column )
    [ [AS] { VALIDTIME | TRANSACTIONTIME } ]
table_level_definition
{ unique_definition | reference_definition | check_definition }
column_constraint_attributes
[ CONSTRAINT name ] {

  [ time_option ] { CHECK ( boolean_condition ) | UNIQUE | PRIMARY KEY } |

  [ RI_time_option ] REFERENCES WITH NO CHECK OPTION
    table_name [ ( column_name ) ]
}
temporal_column
{ { PERIOD (DATE) | PERIOD ( [ ( precision ) ] [ WITH TIME ZONE ] ) }
    [ NOT NULL ] [AS] VALIDTIME |

  PERIOD ( TIMESTAMP(6) WITH TIME ZONE ) NOT NULL [AS] TRANSACTIONTIME
}
unique_definition
[ CONSTRAINT name ]
  [ time_option ]
  { UNIQUE | PRIMARY KEY }
  ( column_name [,...] )
reference_definition
[ CONSTRAINT name ]
  [ RI_time_option ]
  FOREIGN KEY
  ( column_name [,...] )
  REFERENCES WITH NO CHECK OPTION table_name [ ( column_name [,...] ) ]
check_definition
[ CONSTRAINT name ]
  [ time_option ]
  CHECK ( boolean_condition )
time_option
CURRENT TRANSACTIONTIME
  [ AND [ CURRENT | SEQUENCED | NONSEQUENCED ] VALIDTIME ]
RI_time_option
{ CURRENT | SEQUENCED | NONSEQUENCED } TRANSACTIONTIME
  [ AND [ CURRENT | SEQUENCED | NONSEQUENCED ] VALIDTIME ]
]