📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

A junction table with a surrogate primary key, such as EnrolmentID, still needs what?

A. No other constraints
B. Only a NOT NULL on Grade
C. A unique constraint on EnrolmentID only
D. A UNIQUE constraint on the StudentID and CourseID pair to prevent duplicate enrolments ✅

Correct Answer: D. A UNIQUE constraint on the StudentID and CourseID pair to prevent duplicate enrolments

Explanation

A surrogate key does not stop the same pair being inserted twice, so the pair itself must also be unique.