15.00 - Rules for Table-Level FOREIGN KEY … REFERENCES Constraints Only - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Rules for Table‑Level FOREIGN KEY … REFERENCES Constraints Only

The following rules applies to table-level FOREIGN KEY … REFERENCES constraints only.

  • You must specify a complete FOREIGN KEY (referencing_column_set) REFERENCES (referenced_table_name) specification for the foreign key definition.
  • If you do not specify the optional referenced_column_set in the foreign key definition, Teradata Database assumes that the columns in the referencing column set have the identical names as the implied columns in the referenced column set.
  • If the referenced column set columns do not have the same names as their counterparts in the referencing_column_set list, you must specify their names using the FOREIGN KEY (referencing_column_set) REFERENCES referenced_table_name (referenced_column_set) syntax.
  • The optional keywords WITH CHECK OPTION and WITH NO CHECK OPTION define a foreign key constraint as being either a batch referential integrity constraint or a Referential Constraint, respectively.
  • If you specify neither set of keywords, the foreign key constraint defines a traditional foreign key constraint by default.

  • A maximum of 100 table-level constraints can be defined for any table.