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 > DB Design for parameters with values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-11, 23:07
WesternRider WesternRider is offline
Registered User
 
Join Date: Apr 2011
Posts: 1
Question DB Design for parameters with values

Hi All

I am a bit new to relational DB design and seek your opinion on the following:

I am working on an application in which I want to build models which are definable by a user. A model will consist of a number of parameters.

I want to create a table (let's call it parm_table) which has a record for each for each parameter; parm_table will contain columns like: parameter_name; parameter_type; min_value; max_value; default_value; display_format; and possibly more.

Each parameter will be assigned values over time. I want to store these values in another table (value_table) which has a one to many relationship with the parm_table (a parameter can have many values; a value belongs to one parameter).

I don't know how to do this most efficiently. Because a parameter has a type which could be various number formats or a string, the value table would have to hold values of different types. I guess one could save all values as an Ascii string and convert back and forth whenever used, but that does not seem very easy to me. I might also have more value tables, one for each type, but then the code needs to access different tables depending on the type. Not sure that's easy either.

Do you have any ideas or best practices for this?

Thanks for any advice you can provide!
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