📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

A table has a primary key on (StudentID, CourseID). A new row has StudentID 12 and CourseID NULL. What happens?

A. The row is accepted because StudentID is unique
B. The row is rejected because part of a composite primary key is null ✅
C. The row is accepted if CourseID is later filled
D. The row is stored as a duplicate

Correct Answer: B. The row is rejected because part of a composite primary key is null

Explanation

No part of a primary key may be null, so a composite key with any null component violates entity integrity.