📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

In OrderDetail(OrderID, ProductID, Quantity, Price), why is (OrderID, ProductID) a suitable composite key?

A. OrderID alone is unique in this table
B. ProductID alone is unique in this table
C. Quantity is never repeated
D. The same product can appear in different orders, and the same order can contain different products ✅

Correct Answer: D. The same product can appear in different orders, and the same order can contain different products

Explanation

The pair is unique because a product appears at most once in a given order, although each part repeats separately.