Referential Integrity

Keeping data modifications consistent throughout all tables in a database is called referential integrity.

insert, update, delete, writetext, and truncate table allow you to change data without changing related data in other tables, however, disparities may develop.

One way to manage data consistency is to define referential integrity constraints for the table. Another way is to create special procedures called triggers that take effect when you give insert, update, and delete commands for particular tables or columns (the truncate table command is not caught by triggers or referential integrity constraints).

For example, if you change the au_id entry for Sylvia Panteley in the authors table, you must also change it in the titleauthor table and in any other table in the database that has a column containing that value. If you do not, you cannot find information such as the names of Ms. Panteley’s books, because you cannot make joins on her au_id column.

To delete data from referential integrity tables, change the referenced tables first and then the referencing table.

Related concepts
Triggers: Enforce Referential Integrity
Databases and Tables