Referential+Integrity+Definition

Referential integrity in a RDBMS means that there cannot be a foreign key value without a related primary key value.

Consider the relation:

Now consider the following sample data:

The attribute **borrower_id** is the primary key of the relation //**borrower**//, and a foreign key of the relation //**transaction**//. If referential integrity exists, then for every value of **borrower_id** in the relation //**transaction**// there must be a corresponding value of **borrower_id** in the relation //**borrower**//.

If the borrower TT149 (J Edwards) is deleted from the relation borrower, then transaction_number X1571 must also be deleted from the relation transaction in order to maintain referential integrity. This is known as a cascade deletion.

Similarly, if borrower_id TL095 was modified to TL00095 in the relation borrower, then the borrower_id value for transaction X1572 would also have to be modified to TL00095 in order to maintain referential integrity. This is known as a cascade modification.