We're adding functionality to allow product building.
For example, user can configure different attributes which can either be a plain value (height, color etc) or an existing product (there can be a choice of knobs for a piece of furniture).
I'm now constructing the DB design, and I'm looking for suggestions. What I came up with is the following.
Products - existing products table Ex: ProductA
ParentProducts - idParentProduct Ex: ProductB
ParentProduct_Attributes - idParentProduct, idAttribute, Type (Product/Value) Ex: Height, Knob
ParentProduct_Attribute_Values - idAttribute, idValue, Value Ex: 10"
ParentProduct_Attribute_ChildProducts - idAttribute, idChildProduct, Type (Reg. Product / Child Product) Ex: ChildProductA, ProductA
ChildProducts - idChildProduct
This just seems like a lot of steps to get the actual attribute value.
For example, I have a piece of furniture, ProductB. ProductB has height and Knob. The choices for height are 10", 12" (values), and the choices for knobs are ChildProductA, ProductA (Products) - each coming from different tables. ChildProductA is a childproduct, while ProductA is a regular product, so again, two separate tables.
Any input on this? Different ideas?
Hope I was clear.
Thank you.