Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-16-2004, 07:48 PM   PM User | #1
Kurashu
Regular Coder

 
Join Date: Aug 2004
Location: The US of A
Posts: 767
Thanks: 1
Thanked 0 Times in 0 Posts
Kurashu is an unknown quantity at this point
Little problem

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?
Kurashu is offline   Reply With Quote
Old 10-17-2004, 12:55 AM   PM User | #2
Kiwi
Regular Coder

 
Join Date: Oct 2002
Posts: 380
Thanks: 0
Thanked 0 Times in 0 Posts
Kiwi is an unknown quantity at this point
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

and

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
__________________
Strategy Conscious

Last edited by Kiwi; 10-17-2004 at 12:58 AM..
Kiwi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:09 PM.


Advertisement
Log in to turn off these ads.