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 > Question about Best Practice...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-28-08, 08:49
astrocrep astrocrep is offline
Registered User
 
Join Date: Feb 2008
Posts: 4
Question about Best Practice...

I am working on the Schema for an Online video game.

Among all the DB tables are two specific tables called: heroes and skills.

The Heroes table will contain the general make of a user's playable character.

Heroes will be something like:
hero_id
hero_name
hero_level
hero_type
...

The Skills table will contain the definitions for all possible skills in the game.

The Skills table will be something like:
skill_id
skill_name
skill_type
...

Every character will have a max of 10 unqiue skill, and then a possible 10 common skills for a constant max of 20 skills per hero.

Would it be better to Store the hero skill information on the hero table like:
hero_skill_0, hero_skill_1, hero_skill_2, ..., hero_skill_9
hero_common_skill_0, hero_common_skill_1, hero_common_skill_2, ..., hero_common_skill_9

OR

Have a third table called: HeroSkills which is simply something like:
hero_skills_id
hero_id
skill_id
skill_level

I believe that having a 3rd table would be best practice... but my concern is in the 0.000001% chance the game gets big. With a lot of players the HeroSkills table will be 20 times larger then the heroes table, but will also be getting alot more transactions.

So what do you think.

Thanks in advance for the help,
Rich
Reply With Quote
  #2 (permalink)  
Old 02-28-08, 08:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
separate table

here's a simple test: using the 20 numbered columns model, write the sql query that finds all players that have both skills 9 and 37
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-28-08, 09:02
astrocrep astrocrep is offline
Registered User
 
Join Date: Feb 2008
Posts: 4
Point taken,

Thanks for the fast reply!

-Rich
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