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 (a table containing information which parts a customer has ordered), 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.