Reputation: 1
I have a problem designing database for a configurable product. My application requirement is to create a configurable product from components which can also be sold separately
The products which can be sold alone have common attributes like size and color which can be combined while selling single
Also there is a Standard configuration and customized configuration which needs to be saved in database
Eg:- Bed being a configured product, it consist of Base, Middle-Mattress, Top-Mattress, Legs, Headboard... All of this components except Base can be sold individually There common attributes are size and color while Middle-Mattress has got a additional attribute as Firmness
The design that i came up with till now is ....
Component_Master
comp_id
comp_name
comp_desc
comp_type
sold_alone
Component_Attribute_Header
attrib_id
comp_id
attrib_name
Component_Attribute_Details
attrib_id
attrib_details_id
value
Now I am stuck at designing tables for standard configuration and customized configuration
Can anyone please help me with this design
Thanks in advance,
Siddhesh Tawde
Upvotes: 0
Views: 888
Reputation: 3413
You may do this:
A product should have one or more parts. Each part should have one or more attributes. An assembly is a relation between parts and a product, once one part should be in different products, and one product should have one or more prarts. Customize the fields according to your specifications.
tbl_product
-----------
prd_id:long PK
prd_name:string
prd_date:datetime
tbl_parts
---------------
comp_id:long PK
comp_name:string
comp_description:string
comp_type:long
comp_sold_alone:boolean
comp_can_assembly:boolean
tbl_assemblies
--------------
ass_id:long PK
ass_description:string
ass_date:datetime
ass_product:long FK (tbl_products)
ass_part_id:long FK (tbl_parts)
tbl_attributes
--------------
atrb_id:long PK
atrb_description:string
atrb_part:long FK (tbl_parts)
Upvotes: 2