A-Z Popular Blog Databases Search »
Related Guides

What is Referential Integrity?

 , updated on
Referential integrity is the validity of relations in a database.

Technical Details

Referential integrity is the validity of foreign keys in a relational database. If you create a row with a foreign key, that foreign key needs to exist in the parent table as a primary key. Likewise, if you delete a row that is referred to by the foreign keys of child rows, those child rows need to be updated.


It is common for databases to enforce referential integrity automatically. This behavior can be defined for keys in a table definition. The following are common options.
Don't allow parent rows to be deleted or their primary key updated. In this case, you need to update the foreign keys of child rows before deleting the parent.
When a parent row is deleted or updated, set related foreign keys to null.
When a parent row is deleted or updated, set related foreign keys to a default value.
When a parent row is updated, related foreign keys are updated. When a parent row is deleted, child rows are deleted.
Databases may support complex custom rules for referential integrity such as performing different actions depending on the value of the key.


An Employee table has a OFFICE_ID foreign key that refers to the primary key of the OFFICE table. The data definition instructs the database if an OFFICE is deleted to set all related Employee rows to a default that points to the head office of the firm.
Overview: Referential Integrity
The validity of relations in a database.
Related Concepts
More about databases:
Database Index
Candidate Key
Data Purging
Foreign Key
Federated Databases
Primary Key
Operational Database
Referential Integrity
Unique Constraint
If you enjoyed this page, please consider bookmarking Simplicable.


A list of database terms.

Primary Key vs Candidate Key

The difference between primary key and candidate key including an example.


The definition of atomicity with common examples.

Operational Database

A definition of operational database with examples.

Database Skills

A list of common database skills.

Row vs Column

The difference between row and column explained with examples.


An overview of data with a list of examples.

Social Data

An overview of social data with examples.

Information Things

A list of things that can be considered information.

IT Gaps

An overview of IT gaps with examples.

Data Quality Examples

An overview of data quality with examples.

Legacy Data

An overview of legacy data with examples.

Customer Analytics

An overview of customer analytics with examples.

Uncertainty Principle

An overview of the uncertainty principle with examples.

Regression Analysis

An overview of regression analysis with examples.

Unstructured Data

A definition of unstructured data with examples.
The most popular articles on Simplicable in the past day.

New Articles

Recent posts or updates on Simplicable.
Site Map