15.00 - CREATE TABLE (Column Definition Clause) - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

CREATE TABLE (Column Definition Clause)

About Table Column Elements

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.

The following optional column attributes are also elements of the SQL column definition clause.

  • Data type attribute declaration
  • Column nullability
  • Multi-value and algorithmic compression
  • Column storage attributes
  • Output format attributes
  • Default value attributes
  • See SQL Data Types and Literals 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.