I have two columns in a table that will always be unique, vendor_identifier and product_identifier. Both of them are about equal length. Should I add both of them as primary keys, or only one, or some variant of that? Is there any difference between adding one or two here?
I have two columns in a table that will always be unique, vendor_identifier and
Share
You can only have one be the primary key. You can have the other be a UNIQUE key.
Whichever you prefer to be the default PRIMARY KEY is your choice.
There is something you need to ask yourself:
Answering these rhetorial questions will help you decide whether a table has one of the following as the PRIMARY KEY