Table Column Elements | CREATE TABLE | Teradata Vantage - About Table Column Elements - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

This clause defines the table column elements.

You must specify a name and data type for each column defined for a table. When you create a table copy using the CREATE TABLE … AS syntax, you either carry over the source table column types by default or specify new column data types using a query expression. Each data type can be further defined with one or more attribute definitions.

You can specify the following optional column attributes:
  • Data type attribute declaration
  • Column nullability
  • Multivalue and algorithmic compression
  • Column storage attributes
  • Output format attributes
  • Default value attributes

    See Teradata Vantage™ - Data Types and Literals, B035-1143 for details about the preceding list of attributes.

  • Column constraint attributes
    • PRIMARY KEY constraint definition
    • UNIQUE constraint definition
    • FOREIGN KEY ... REFERENCES constraint definition
    • CHECK constraint definition
    • Row-level security constraint assignments.

    You can also specify PRIMARY KEY, UNIQUE, FOREIGN KEY, and CHECK constraints as table attributes, but you cannot specify a row-level security constraint as a table attribute.