The Wayback Machine - https://web.archive.org/web/20040925215651/http://databases.about.com:80/cs/administration/g/refintegrity.htm
 You are here:
About>Computing & Technology>Databases
About.com
 

FREE Newsletter

 
Databases
Stay up to date!

“Referential Integrity”

Glossary

Your Guide, Mike ChappleFrom Mike Chapple,
Your Guide to Databases.
FREE Newsletter. Sign Up Now!
Definition: Referential integrity is a database concept that ensures that relationships between tables remain consistent. When one table has a foreign key to another table, the concept of referential integrity states that you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table. It also includes the techniques known as cascading update and cascading delete, which ensure that changes made to the linked table are reflected in the primary table.

Consider the situation where we have two tables: Employees and Managers. The Employees table has a foreign key attribute entitled ManagedBy which points to the record for that employee’s manager in the Managers table. Referential integrity enforces the following three rules:
  1. We may not add a record to the Employees table unless the ManagedBy attribute poi
  2. nts to a valid record in the Managers table.
  3. If the primary key for a record in the Managers table changes, all corresponding records in the Employees table must be modified using a cascading update.
  4. If a record in the Managers table is deleted, all corresponding records in the Employees table must be deleted using a cascading delete.
  Topic Indexback to top
email to a friend email to a friend   decrease font size increase font size font sizeAbout.com
Our Story | Be a Guide | Advertising Info | Investor Relations | Work at About | Site Map | Icons | Help
©2004 About, Inc. All rights reserved. A PRIMEDIA Company.
User Agreement | Privacy Policy | Kids' Privacy Policy