I'm designing a web site for a client that also wants to sell his products on his site. But I cam accross a slight dB related problem.
Originaly, I had this set-up
table: products
ProductID (PK)
CategoryID
ProductName
UnitSize1
UnitSize2
UnitSize3
UnitSize4
UnitPrice1
UnitPrice2
UnitPrice3
UnitPrice4
DescriptionShort
Then I created the site, and all went according to plan, except when I tried to delete a specific product of a specific size from the shopping cart, when I did that all sizes of that product name got deleted. I realized why that happened, all 3 (or 4) sizes have the same productID.
So then I re-tooled, so now I have this set-up:
table: products
ProductID (PK)
CategoryID
ProductName
UnitSize
UnitPrice
DescriptionShort
When I do it this way, I can delete a specific product name of a spcific size, and all's well with the world. My only problem is the visual aspect of this now. Before I listed each product name once, and now each product name is listed 3 times (because of the diff. sizes), which makes the dB larger.
What would be the optimal way of desiging the dB, to do what I want?
Thanks.
Reality continues to ruin my life...
Originaly, I had this set-up
table: products
ProductID (PK)
CategoryID
ProductName
UnitSize1
UnitSize2
UnitSize3
UnitSize4
UnitPrice1
UnitPrice2
UnitPrice3
UnitPrice4
DescriptionShort
Then I created the site, and all went according to plan, except when I tried to delete a specific product of a specific size from the shopping cart, when I did that all sizes of that product name got deleted. I realized why that happened, all 3 (or 4) sizes have the same productID.
So then I re-tooled, so now I have this set-up:
table: products
ProductID (PK)
CategoryID
ProductName
UnitSize
UnitPrice
DescriptionShort
When I do it this way, I can delete a specific product name of a spcific size, and all's well with the world. My only problem is the visual aspect of this now. Before I listed each product name once, and now each product name is listed 3 times (because of the diff. sizes), which makes the dB larger.
What would be the optimal way of desiging the dB, to do what I want?
Thanks.
Reality continues to ruin my life...