Thread: database design...
03-14-04, 20:02 #1Registered User
- Join Date
- Mar 2004
Unanswered: database design...
I'm trying to design a database structure for the purpose of keeping track of recent programs and their features.
* Each program is organized in a category and section.
* There is a set of pre-determined features that any program may have.
Example of features:
Language Written in:
When listing the programs, a tick beside the feature would indicate that a featuere is supported.
I would like to design the database such that any feature can be added/removed easily at any time (like for example adding Solaris to the list above for features supported).
I initially thought of having the following tables:
id, author, name, description, addDate
prog_id, feature1, feature2, feature3, ....
And whenever I want to add support for a feature in general, I would just alter the table to add a column.
However, this design is not that scalable and flexible. For example, if I would like to also store the date of when a feature of a program was added, then that's not possible with the table design I provided.
Does anyone have any suggestions of how I would design the tables such that it incorporates the ideas I just mentioned?
Thanks for everybody's help.
03-15-04, 05:19 #2Registered User
- Join Date
- Jan 2004
I would recommend a more flexible structure. I would design it this way:
program m:n features
program m:n platform
program m:n author
so get seven tables:
table -> columns -> Primary key -> foreign key
program -> id, name, description -> id
features -> f_id, feature_name -> f_id
platform -> p_id, platform_name ->p_id
author -> a_id, authors_name -> a_id
program_author -> id, a_id -> (id,a_id)->id, a_id
program_features -> id, f_id -> (id,f_id) -> id, f_id
program_platforms -> id,p_id -> (id, p_id) -> id, p_idboard.perl-community.de - The German Perl-Community