📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

A School changes a ClassID and ON UPDATE SET NULL is defined on Student.ClassID. What happens?

A. Students are deleted
B. Students move to a default class
C. The update is rejected
D. Students in that class get ClassID set to NULL ✅

Correct Answer: D. Students in that class get ClassID set to NULL

Explanation

SET NULL on update clears the link when the parent key changes, leaving the students unassigned.