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.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
jpx1556733107962.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

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

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.