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 > Database Server Software > MySQL > Major Design Concept

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-07, 13:35
asanieyan asanieyan is offline
Registered User
 
Join Date: Feb 2007
Posts: 2
Red face Major Design Concept

Hi,

I am trying to develop an online application like ebay using rubyonrails.
now my problem is how to design my database to support all these different product types each having different attributes without actually creating a table for each product type. also bear in mind that a product type may have sub category and also the sub category might have another sub category and so on.
did ebay actually created a model and a table for each of the product type because that's not very efficient ?

can some one please help me ?
Reply With Quote
  #2 (permalink)  
Old 02-15-07, 15:08
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
no idea what ebay does

this might help you -- Categories and Subcategories
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-15-07, 16:52
asanieyan asanieyan is offline
Registered User
 
Join Date: Feb 2007
Posts: 2
Red face 1 solve one more to go

Thanks , the posting answer my first problem of how to store my data as a tree , now how can i represent each leaf as a product with different attributes. for example one leaf might be a computer desktop with a desktop attributes and one might be shoe do i need a separate table for each of these products ?

Thanks
Reply With Quote
  #4 (permalink)  
Old 02-15-07, 19:39
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
no, one table for the products

if a product can belong to more than one category or subcategory, then you would need a many-to-many relationship table as well

but if a product is found under only one (sub)category, no matter at what level of the category hierarchy, then all you need is a category foreign key in the product table
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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