📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

A university wants to delete a Department that still has Students. Which foreign-key action best protects the students’ records from accidental loss?

A. ON DELETE CASCADE
B. ON DELETE RESTRICT ✅
C. ON DELETE SET NULL
D. ON DELETE SET DEFAULT

Correct Answer: B. ON DELETE RESTRICT

Explanation

RESTRICT blocks the delete while students still reference the department, forcing a deliberate decision about the students first.