You might want to use referential integrity in your database management
system for several reasons.
You might want to ensure data integrity with referential constraints
- To make sure that data values between files meet the rules of your business.
For example, consider a business that maintains a list of customers in one
file and a list of their accounts in another file. It does not make sense
to allow the addition of an account if an associated customer does not exist.
Likewise, it is not reasonable to delete a customer until you delete all of
their accounts.
- To be able to define the relationships between data values.
- To have the system enforce the data relationships no matter what application
makes changes.
- To improve the performance of integrity checks that are made at a high-level
language (HLL) or SQL level by moving the checking into the database.