UNIQUE constraint on non-"key" columns
Date: Fri, 26 Nov 2004 04:54:44 GMT
Message-ID: <8gbdq0ppdg16gvp9ra2ch8at9qve1g38u6_at_4ax.com>
Hello.
After waking up at 04:30 and not being able to go to sleep again, a
thought crossed my mind, regarding a table of inventory items. You
have a table like this:
CREATE TABLE items
My thought was that item_descr rather should be UNIQUE as well,
(
item_no VARCHAR(15) NOT NULL,
item_descr VARCHAR(40) NOT NULL
UNIQUE (item_no)
)
An example.
Suppose you are into selling clothes, and you have the following
stock:
item_no item_descr
(These are unisize and unisex models)
They differ only in price, because of different manufacturer. Would
------- ----------
shrt1B Shirt, black
shrt1BHQ Shirt, black
So, is it only fatigue or are there any valid points in this reasoning?
-- Jan Hvarfvenius NB: The e-mail address is not invalidReceived on Fri Nov 26 2004 - 05:54:44 CET
