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 > normalisation and design for products db

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-05-03, 10:59
DizzyBird DizzyBird is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
normalisation and design for products db

I'm failing to get my head around a normalisation and db design issue, and was hoping someone may be able to offer some comments.
I have two tables ProductGroups and ProductItems.
ProductGroups has a Manufacturer, Model, and Image (cutting it to basics)
ProductItems has a MasterID field - relating to a ProductGroup so that each item can be associated with a particular ProductGroup, however, although the majority of items are specifically associated with one ProductGroup some items are more general and can be associated with any number of ProductGroups.
I'm not sure how to address this in the best manner, as I don't want to be repeating data as will be the case currently. Will it be best to have one productitems table for specifically related items and one for the more general items? The more I think about it the more I seem to confuse myself!
Any help greatly appreciated.
D.
Reply With Quote
  #2 (permalink)  
Old 11-05-03, 23:06
NeoNite NeoNite is offline
Registered User
 
Join Date: Nov 2003
Posts: 1
My friend it looks as if you have a many to many relationship here even though its only some of the time that their are general items not listed in the Products Group table. I believe you will need to have an intersection table to split this M:N relationship. Example is Sale,LineItem and Items. In this example there can be many items to LineItem and many LineItems in Sales. Hope this helps! I am a newbee at this as I am still completing my MIS Degree but I believe I have this concept down.
Reply With Quote
  #3 (permalink)  
Old 11-06-03, 05:00
gannet gannet is offline
Registered User
 
Join Date: Oct 2002
Location: Plymouth UK
Posts: 116
To be be more specific for your problem. You will need another table to link the ProductGoups to the ProductItems. This table will have a PK made up of two FK links --- PK of ProductGroups and PK of ProductItems

Something like this:

ProductGroups(group_id, Manufacturer, Model, [other fields]...)
ProductGroupItems(group_id, item_id)
ProductItems(item_id, [other fields]...)
Reply With Quote
  #4 (permalink)  
Old 11-10-03, 03:59
DizzyBird DizzyBird is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Cheers

Thanks Guys,

That works splendidly.

D.
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