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

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

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.