When we say a database
has data integrity, we ensure that all tables in the database
contain accurate and consistent data. For example, before we
insert new data in CUSTOMER_ORDER table, we make sure the items
to be ordered exist in PARTS table.
Constraint, also
referred to integrity constraint, is an effective way to ensure
data integrity in a relational database. There are several types
of commonly used integrity constraints, including domain integrity
such as not null and check constraints, as well as referential
integrity. This discussion focuses on referential integrity.