Problem Statement
Which is a valid reason to use a composite PRIMARY KEY?
Explanation
Composite keys model identities like (order_id, line_no) or (country_code, phone). They encode business meaning and enforce pair uniqueness.
They do add key width to child tables. Consider a surrogate key if many foreign keys must reference the row.
Code Solution
SolutionRead Only
PRIMARY KEY (order_id, line_no)
Practice Sets
This question appears in the following practice sets:
