17.10 - Comparison of Referential Integrity Constraint Types - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1184-171K
Language
English (United States)

The following table compares the three referential integrity constraint types supported by Vantage.

Referential Constraint Type DDL Definition Clause Does It Enforce Referential Integrity? Level of Enforcement
Standard REFERENCES Yes Single row
Batch REFERENCES WITH CHECK OPTION Yes All child table rows must match a parent table row.

The different types have different applications, as the following table documents.

Referential Constraint Type Application
Standard
  • Tests each individual inserted, deleted, or updated row for referential integrity.
  • Not valid for temporal tables.
  • If insertion, deletion, or update of a row would violate referential integrity, then AMP software rejects the operation and returns an error message.
  • Permits special optimization of certain queries.
Batch
  • Tests an entire insert, delete, or update request operation for referential integrity. In this context, a batch operation is defined as an implicit SQL transaction.
  • Not valid for temporal tables.
  • If the result of the request violates referential integrity, the system returns an error to the requestor.
  • Permits special optimization of certain queries.