PrepZone Logo
PrepZone
Back to Database

Database · Easy

What is referential integrity? Explain ON DELETE CASCADE, SET NULL, and RESTRICT.

DatabaseFundamentalsFresher

Answer preview

Referential integrity means every non-NULL foreign key value must match an existing primary key in the parent table — no orphan rows. The database enforces it on insert, update, and delete, and referential actions (ON DELETE / ON UPDATE) declare what happens to children when the …