If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > products , attributes and details

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-04, 15:16
codergish codergish is offline
Registered User
 
Join Date: Jan 2004
Location: Canada
Posts: 6
products , attributes and details

What is the recommended design for the following needs:

I have a "products" table that consists of field id, name and type.
I also have a attributes table that consists of all attributes for any and all products we have. I also have a attributes-join-products table, which joins up which attt can belong to which prod. My only issue now is. How/what is the best structure to store the actuall "details" of the product attributes?

Thanks

CG
Reply With Quote
  #2 (permalink)  
Old 02-11-04, 15:53
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
If I understand the question, the answer is to create a one to many relationship between the attributes-join-products table and a product attribute details table.
__________________
visit: relationary
Reply With Quote
  #3 (permalink)  
Old 02-11-04, 18:49
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
If I understand correctly, the proposed table design is,

Products(Product_id, product_name)
Attributes(Attribute_id, attribute_name, Product_ID)

Product_Details(Attribute_ID, attribute_value)

I would not recommend this design, on the basis that "attribute_value" is restricted to a single datatype. As an alternative, I would create Super / Sub type entities.
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Reply With Quote
  #4 (permalink)  
Old 02-11-04, 19:03
codergish codergish is offline
Registered User
 
Join Date: Jan 2004
Location: Canada
Posts: 6
Quote:
Originally posted by r123456
If I understand correctly, the proposed table design is,

Products(Product_id, product_name)
Attributes(Attribute_id, attribute_name, Product_ID)

Product_Details(Attribute_ID, attribute_value)

I would not recommend this design, on the basis that "attribute_value" is restricted to a single datatype. As an alternative, I would create Super / Sub type entities.
ok thanks....good point on the single datatype....please explain a super / sub type example, lets see if I understand...

Thanks again.
Reply With Quote
  #5 (permalink)  
Old 02-11-04, 19:08
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
Products (product_id, common_attributes, type)

ProductA(product_id, specific_attributes)
ProductB(product_id, specific_attributes)

I would recommend enforcing the constraint that a product_id can exist in at most one sub entity.
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Reply With Quote
  #6 (permalink)  
Old 02-16-04, 10:39
rmuller rmuller is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
Do you have "real world" experience with this design? If so, have you any information about the performance in LARGE environments (>50.000 products and many > 100 subtypes)? Is the performance better than the more traditional Product/Attribute model?

Regards,
Ronald
Reply With Quote
  #7 (permalink)  
Old 02-16-04, 10:46
codergish codergish is offline
Registered User
 
Join Date: Jan 2004
Location: Canada
Posts: 6
I am curious to see the performance as well, we will have > 50000 products and > 100 'types'....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On