📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

A junction table Enrolment has ON DELETE CASCADE on both StudentID and CourseID. What happens when a Course is deleted?

A. Nothing is deleted
B. Only the Enrolment rows for that course are deleted; Student rows and other enrolments remain ✅
C. All courses are deleted
D. All students are deleted

Correct Answer: B. Only the Enrolment rows for that course are deleted; Student rows and other enrolments remain

Explanation

CASCADE on a junction foreign key removes only the links for the deleted side, not the entities themselves.