Data and Referential Integrity in Relational Databases


Data integrity in a database can be divided into four seperate areas.

  1. Entity integrity - ensures no duplicate rows allowed. This is usually dependant upon the use of a unique index or primary key. A primary key is a unique index.

  2. Domain integrity - the values of any given column fall within an accepted range. This makes use of validation rules attached to specific table columns. Also items such as column display formats would be included here.

  3. Referential integrity - foreign key values point to valid rows in the referenced table. The implementation also applies to the use of cascading updates and deletes or the prevention thereof. Note that use of cascading updates and deletions is adventurous. It is better to makes use of triggers and rules in order to disallow the deletion of primaries without the deletion of their subset foreign key data set rows first.

  4. User defined integrity - data complies with applicable business rules. Business rules are application specific.