15.00 - Enforcing the Referential Integrity Rule - Teradata Database

Teradata Database Design

Teradata Database
User Guide

Enforcing the Referential Integrity Rule

The relational model states the Referential Integrity rule without providing a mechanism to enforce it. In practice, the rule is enforced through the PRIMARY KEY and FOREIGN KEY clauses in the CREATE TABLE statement. The keyword REFERENCES describes the table and column set in which the primary key image of the foreign key resides.

The REFERENCES WITH NO CHECK OPTION specification explicitly instructs Teradata Database not to enforce referential integrity on the specified relationship. See “Foreign Key Constraints” on page 644 for further information.

When referential integrity is enforced, you cannot delete a row from the referenced (parent) table as long as there is a row in the referencing table whose foreign key matches it.