View Full Version : Little problem

Oct 16th, 2004, 08:48 PM
Once again, I am running PostGre for those that don't know.

Ok, what I am trying to do is set up a database for a Halo Site I will be working in the future; however, I want to get the databse out of the way right now. What my problem is: Halo's Gametypes. Each gametype has a different number of options. Other than creating a different table for each one, the best solution I have found is creating a text array feild in the gametype table. Is there a better solution for this or are my choices limited to Arrays and Multiple Tables?

Oct 17th, 2004, 01:55 AM
To me it would make more sense to put the game-types in one table, and the options in another, with either a parent child-relationship or a joining table, depending on whether most options are found on more than one gametype. It It partly depends on how similar the information you have to store for each option is. These are the standard approaches for one to many (parent child) or many to many (joining) relationships.

TABLE gametypes:
gametype ID (key)
All data common to most gametypes


EITHER (one options table)

TABLE gt_options:
gt_option ID (key)
gametype ID (foreign key)
All data relatiing to this option for this gametype

OR (joining table):
TABLE options
gt_option ID (key)
All data common to this option - eg description

TABLE gt_options
gt_option ID (key) (foreign key)
gametype ID (key) (foreign key)
Specific data for this gametype option combination