📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which statement about ON UPDATE RESTRICT is correct?

A. It deletes child rows when the parent key changes
B. It prevents changing a parent key value while child rows refer to it ✅
C. It sets child foreign keys to NULL on update
D. It updates child rows automatically

Correct Answer: B. It prevents changing a parent key value while child rows refer to it

Explanation

RESTRICT blocks a parent-key update if any child still references the old value.