15.00 - Comparison of Referential Integrity Constraint Types - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Comparison of Referential Integrity Constraint Types

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, then it aborts and the system returns an error to the requestor.
  • Permits special optimization of certain queries.