Skip to main content

What is referential integrity?

Mid MySQL
Quick Answer Referential integrity ensures relationships between tables stay valid. A foreign key value in the child table must either match a primary key in the parent table or be NULL. InnoDB enforces this: you can't insert a child row with a non-existent parent, and you can't delete a parent row that child rows reference (unless CASCADE is configured). Maintains data consistency across related tables.

Answer

Referential integrity ensures foreign keys always refer to valid rows, preventing orphaned records.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice