In table OrderItem(order_id, product_id, quantity), neither order_id nor product_id is unique alone, so the primary key is declared as (order_id, product_id). What is such a key called?
Correct answer B. Composite key
Explanation
A composite (compound) key is made of two or more attributes that together identify a row, even though no single one does. Here an order contains many products and a product appears in many orders, but each (order, product) pair appears once. A surrogate key would be an artificial single column such as item_id. Each part may also be a foreign key, but the combined key is composite.
Answer checked How we write and check questions
Discussion