📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which scenario requires a composite foreign key?

A. When the referenced primary key itself is composite, such as OrderItem referenced by OrderID and ItemNo together ✅
B. When a table has only one column
C. When a table has no primary key
D. When a foreign key is unique

Correct Answer: A. When the referenced primary key itself is composite, such as OrderItem referenced by OrderID and ItemNo together

Explanation

A composite foreign key must match all columns of a composite primary key, in the same order and number.