Referential integrity |
Referential integrity in a relational database is consistency between coupled tables. Referential integrity is usually enforced by the combination of a primary key and a foreign key. For referential integrity to hold, any field in a table (database) that is declared a foreign key can contain only values from a parent table s primary key field. For instance, deleting a record that contains a value referred to by a foreign key in another table would break referential integrity. The relational database management system (RDBMS) enforces referential integrity.
= Example =
An employee Database stores the department in which each employee works. The field DepartmentNumber in the Employee table is declared a foreign key, and it refers to the field Index in the Department table which is declared a primary key. Referential integrity would be broken by deleting a department from the Department table if employees listed in the Employee table are listed as working for that department.
=See also=
= External links =
|
|
