[thelist] RE: DB question: product attributes

Erik Mattheis gozz at gozz.com
Mon Apr 29 17:31:01 CDT 2002


At 2:37 PM -0600 4/29/02, Rebecca Milot-Bradford wrote:
>Do you mean something like:
>id1 T-shirt, large, green
>id2 T-shirt, large, blue
>
>Because if this is what you mean, I HIGHLY recommend against it. Because if
>you have a separate product id for each combination, then if someone does a
>search for shirts, what they get is a list of all of the combinations. I've
>had to work with this system, and it is just ugly.

Agreed ... being that everything is the same for a product except for
it's attributes, you'd have to have a lookup table to keep track of
what products have what names, descriptions and prices so the could
all be updated ... plus you'd have to jump through unnecessary hoops
to figure out sales totals on a per product basis. I ended up doing:

products
--------
product_id
product_name
product_description, [etc]

product_attribute_names
-----------------------
product_attribute_name_id
product_attribute_name
display_sequence

product_attribute_values
------------------------
product_attribute_value_id
product_attribute_name_id
product_attribute_value
display_sequence

product_attribute_lookup
------------------------
product_id
product_attribute_name_id
product_attribute_value_id


--

__________________________________________
- Erik Mattheis

(612) 377 2272
http://goZz.com/

__________________________________________



More information about the thelist mailing list