What Is Referential Integrity?
Referential integrity is the database property that every reference from one table to another points to a row that actually exists. It is enforced through foreign key constraints that reject inserts or deletes which would leave a dangling reference. Maintaining it keeps relationships in the data trustworthy.
Why it matters
Without referential integrity, queries can return rows that reference deleted parents, producing confusing or broken results. Enforcing it in the schema offloads a whole class of consistency checks from application code.
Related guides
What Is a Foreign Key?A foreign key is a column whose values must match a key in another table, linking rows across tables and enfo…
What Is a Surrogate Key?A surrogate key is an artificial identifier, such as an auto-incrementing number or UUID, used as a primary k…
What Is a Natural Key?A natural key is a primary key drawn from meaningful business data that is already unique, such as an email a…