composite key

A key made of two or more columns together, such as order and product on an order line.

In more detail

PRIMARY KEY (order_id, product_id) states the business rule that a product appears at most once per order, so no application code has to enforce it. Each column alone may repeat; only the combination is unique.

Example

PRIMARY KEY (order_id, product_id)

Related terms

Taught in

References