Using Multiple-Field Primary
Keys in a Database
To use multiple
fields in a single primary key
Each part of the
key must follow the same rules as a single primary key.
An example might be
a Part # for a product, which might contain
a part #, a manufacturer code and a
vendor code :

All of the rows
stores data about a part called a “Widget”
but some of the widgets are made by different manufacturers,
and some are even made by the same manufacturer
but purchased from a different vendor.
Point is that they
are all the same thing, except for the manufacturers and vendors
but they have to be stored separately so that they know who made them and who
supplied them
(in case there is a problem and they have to be returned ?).
The primary keys therefore uniquely identify each widget.
The primary key
for the first row is 12345555789
and for the second row is 12345555345.
Notice that only
the last part of the primary key is different
which makes the whole primary key unique,
because the primary key is the combination of all three fields