Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    1

    Unanswered: database design...

    Hello,

    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:
    C/C++
    Assembly
    Visual Basic
    Java

    General Features:
    Pluggable
    Source code
    Documentation
    Price

    Platform:
    Windows
    Linux
    MacOS

    etc....

    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:

    ProgramEntry
    id, author, name, description, addDate

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

  2. #2
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    167
    I would recommend a more flexible structure. I would design it this way:

    relations:

    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_id
    board.perl-community.de - The German Perl-Community

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •