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 > ERD - Right idea?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-11, 17:54
RGM RGM is offline
Registered User
 
Join Date: Feb 2011
Posts: 29
ERD - Right idea?

I've read a bunch of threads/posts before joining and perhaps I've read so much I can't see the wood for the trees anymore or maybe I just don't get it..

My problem is an old one. Products - attributes - values.

I'm no a database pro, but have read enough to figure out EAV is something I should avoid if I can. I'm just not 100% on what I should do.

I'm lucky in that my attributes are dead simple, size and colour (well for now..).
  • One product table with defined attribute fields is out.
  • I did EAV and whilst it works I'm trying to do better.
  • I did a specific size and colour table with a product_id FK. Works fine and is simple. I can't say requirements won't change in the future to include say diameter though.
  • I did product types, with attributes per type which is pretty good

I've ended up with the attached.

I think it will allow me to have a product with variations depending on their selected options and tie a specific price and quantity to that variant.

I'd appreciate any feedback.

Is there any reason why I shouldn't merge "products_pricing" with "products_variants"?
Attached Thumbnails
ERD - Right idea?-grab.jpg  
Reply With Quote
  #2 (permalink)  
Old 02-15-11, 20:18
RGM RGM is offline
Registered User
 
Join Date: Feb 2011
Posts: 29
I 'built' the above and it threw up some problems.

Namely, the relationship: products -> products_options wouldn't allow an option to exist without a product which I suppose makes sense but in (my) real world I'd need to keep "un applied" options.

I updated it to:
Attached Thumbnails
ERD - Right idea?-grab.jpg  
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