AI engineering glossary · SQL databases
What is referential integrity?
Referential integrity: The guarantee that every foreign key value points to an existing row in the referenced table. The database blocks or cascades changes that would break this, such as deleting a customer who still has orders.
Referential integrity: an example
With ON DELETE RESTRICT, deleting customer 7 fails while orders for customer 7 still exist.
Related terms
- Foreign key
- Constraint
- Cascade
More SQL databases terms
Where you learn it
Referential integrity is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.