15.10 - Constraint Attributes - Teradata Database

Teradata Database SQL Data Types and Literals

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1143-151K

Constraint attributes specify integrity rules. Constraints can be any of the following types:

  • Uniqueness (see “Uniqueness Constraints” on page 31).
  • CHECK (see “CHECK Constraints” on page 31).
  • Referential integrity (see “Referential Constraints” on page 32).
  • You can specify constraints during table creation and modification.

    Column constraints apply to single columns as a part of the column definition. Column constraints include:

  • CHECK constraint definition clause on a single column
  • PRIMARY KEY constraint definition clause on a single column
  • REFERENCES constraint definition clause on a single column
  • UNIQUE constraint definition clause
  • Table constraints apply to multiple columns. Table-level constraints include:

  • CHECK constraint definition clause on multiple columns
  • REFERENCES constraint definition clause on multiple columns
  • PRIMARY KEY constraint definition clause on multiple columns
  • UNIQUE constraint definition clause on multiple columns
  • FOREIGN KEY constraint definition clause
  • FOREIGN KEY constraint definitions must also specify a REFERENCES clause.

    The full syntax for constraints is in “ALTER TABLE” and “CREATE TABLE” in SQL Data Definition Language.