Learn VisualLearn DB Visual
JA

Reject Duplicate Identifiers

A primary key uniquely identifies every row and cannot be NULL. UNIQUE protects another candidate key without replacing the primary identifier. For example, UNIQUE (order_id, line_no) allows the same line_no to repeat across orders, but not within one order.

Two orders may both have line_no 1, but one order cannot contain line_no 1 twice. Which constraint fits?