📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

If a foreign key is defined as ON DELETE RESTRICT, what happens when a user tries to delete a parent row that has children?

A. The child rows are deleted automatically
B. The foreign key is set to zero
C. The delete is blocked until the child rows are removed or reassigned ✅
D. The parent row is archived

Correct Answer: C. The delete is blocked until the child rows are removed or reassigned

Explanation

RESTRICT, also called NO ACTION, prevents deletion of a parent that is still referenced, protecting child data.