Re: Help w/ Normalization?

From: <quanunique_at_my-deja.com>
Date: 2000/02/16
Message-ID: <88enf8$ihk$1_at_nnrp1.deja.com>#1/1


> Previously, I had an INVENTORY table. Basic stuff:
>
> SKU
> QUANTITY
> DESCRIPTION
> PRICE
> WEIGHT
>
> Now, there's a new twist. An item can have multiple sizes and/or
> multiple colors and/or any other attribute. But the tricky part is
> that I need to associate a quantity with each combination.
>
> Let's say we are dealing with T-Shirts. I have 10 total. 3 M green. 4 L
> blue, and 3 L white.
>
> They are all the same SKU, but with a slightly different extention.
>
> I don't want to have to repeat the INVENTORY.description for each
> shirt. Because they are exactly the same, just a different size/color,
> and/or price/weight. FOr example, an XXL could be an additional $5.
>

Make it two tables. Table 1 is <SKU, DESCRIPTION> with SKU as key. Table 2 is <SKU, SIZE. COLOR, WEIGHT, PRICE>, with SKU,SIZE,COLOR as key, and with SKU as foreign key. Both tables are normalized, both are BCNF.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Feb 16 2000 - 00:00:00 CET

Original text of this message