Uniqueness over two fields
From: DONNA <donna_at_no.thank.you>
Date: Mon, 01 Jan 2007 15:50:44 GMT
Message-Id: <pan.2007.01.01.15.45.13.268017_at_no.thank.you>
I'm trying to make a database that indexes items sold at online stores.
Date: Mon, 01 Jan 2007 15:50:44 GMT
Message-Id: <pan.2007.01.01.15.45.13.268017_at_no.thank.you>
I'm trying to make a database that indexes items sold at online stores.
One table called 'Stock' will contain items sold at every store included in the project. It will have the fields ID, SKU, Store.
ID will be a unique primary key that respresents the item SKU will be the ID that is used to identify it at that store Store will respresent the store that is selling it
Now each store can only sell one of each item so I'd like SKU to be a unique field. Problems is, two stores might have the same SKU so uniqueness would cause it to break.
What can I do to get around this problem? I could combine SKU and Store into one field unique. Or I could make a new table for each Store, but I'd rather have everything in one long table as the front-end will be displaying all the data together, not per store.
Received on Mon Jan 01 2007 - 16:50:44 CET