User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 373,108 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,634 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser:

Items with some, but not all, fields in common

Join Date: Mar 2008
Posts: 25
Reputation: blater is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
blater's Avatar
blater blater is offline Offline
Light Poster

Re: Items with some, but not all, fields in common

  #2  
Apr 24th, 2008
I wouldn't recommend seperate tables for each of the flavor types. Here are two possible methods....

1) Your first choice - put then into one table. This is relationally correct as the flavor-specific attributes have the flavor as the determinant (i.e they really do belong to the flavor).
i.e
ioPoint
--------
ioPointID
flavorID

ioPointFlavor
-------------
flavorID
port
channel
foo
bar
baz
:
:
etc


If there are a very large number of these attributes you could do the following instead:
ioPoint
--------
ioPointID
flavorID

ioPointFlavor
-------------
flavorID
port
channel


ioPointFlavorAttributes
--------------------------
flavorID
attributeType  string
attributeValue string

Here a list of zero or more attributes and values is associated with each ioPointFlavor.
Depending on your requirements this may make your reporting easier, although maintenance of the will require more programming.
It would make it easy to add new types of flavor attribute. Note you'd probably want a flavor attributeType lookup table as well.
Reply With Quote  
All times are GMT -4. The time now is 5:22 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC