📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which action is typically prevented by ON DELETE RESTRICT on a foreign key?

A. Selecting from the parent table
B. Inserting a new parent row
C. Updating a child row
D. Deleting a parent row that still has child rows ✅

Correct Answer: D. Deleting a parent row that still has child rows

Explanation

  • ON DELETE RESTRICT blocks deletion of a parent row while child rows reference it.
  • CASCADE would delete the children instead.