Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old June 10th, 2003, 08:32 AM
Sarnix Sarnix is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Rotterdam
Posts: 76 Sarnix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 13 m 43 sec
Reputation Power: 6
help needed with design db

Hi,

with a few friends i play some boardgames. Suddenly we felt the need for some statistics, so i thought i'd do the job. But i don't know how to make 1 table.
i have right now
  1. game_id
  2. game_name
  1. player_id
  2. player_name
  3. player_email


but what should the third table look like
is this the proper way
  1. played_game_id
  2. game_id
  3. player_id
  4. score
  5. date


or should it be like this
  1. game_id
  2. player_id
  3. score
  4. player_id
  5. score AND SO ON
  6. date


I hope my problem is clear. with all those lists. It's hard to explain it in words, so i hope the reallife example will speak for itself.

thanks for any help,

Sarnix

Reply With Quote
  #2  
Old June 10th, 2003, 08:51 AM
Targaz's Avatar
Targaz Targaz is offline
I played Richard the Third
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Den Haag, Netherlands
Posts: 122 Targaz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
if i'm correct the combination of game_id and player_id gives you a unique key to identify the third table, so to my oppinion

1 player_id
2 game_id
3 score
4 date
5 etc..

would be sufficient.

You could give the table a unique key for itself, but that's not required.

1 played_game_id
2 player_id
3 game_id
4 score
5 date
6 etc..

I prefer the first option. Put the player_id before the game_id in the table, since there are fewer players than games ( i hope)


Also you might want to reconsider using the underscore "_" in table names

what's wrong with "playerId" ?
__________________
Now is the winter of our discontent made glorious summer by this son of York.

Reply With Quote
  #3  
Old June 10th, 2003, 09:07 AM
Sarnix Sarnix is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Rotterdam
Posts: 76 Sarnix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 13 m 43 sec
Reputation Power: 6
thanks for your answer Targaz

i see,

but would you put multiple players + their scores in 1 record or make a seperate record for each player with his/her score?

i kinda got used to the underscore. is there a serious reason to reconsider?

( sidenote: so far there are more players than games ( kolonisten(dutch), civilization and la citta))

Reply With Quote
  #4  
Old June 10th, 2003, 09:42 AM
Targaz's Avatar
Targaz Targaz is offline
I played Richard the Third
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Den Haag, Netherlands
Posts: 122 Targaz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Ah now I see, a game is not a match but a (board)game.
Silly me (game/set/match)

That could make things a bit more difficult (read interesting).

One entry per game per player per match (date?).

Something like this ?

game
game_id
game_name

player
player_id
player_name

match
match_id
match_date
game_id // one boardgame - one match

playedgames
match_id
player_id
score
- one record for each player that playes the match

Don't pin me down on this, I made it up in five minutes. Maybe you could read some books or search the web on database-design. Comment anybody?

I'm not sure every databasesystem supports underscores that happily. Again comment anybody?

Always happy to help someone who playes Kolonisten van Catan.

Reply With Quote
  #5  
Old June 10th, 2003, 09:55 AM
Sarnix Sarnix is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Rotterdam
Posts: 76 Sarnix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 13 m 43 sec
Reputation Power: 6
Ah yes, that makes sense.
I thought of 3 tables, but 4 tables and the way you describe them seems very suitable for my situation.
thanks, Targaz.

Note taken about the underscore. mysql has no problems with them, so it'll be allright for now.

hehe, you might want to try La Citta if you're looking for a new game to play.

Reply With Quote
  #6  
Old June 10th, 2003, 10:38 AM
Mirax's Avatar
Mirax Mirax is offline
Senior Member
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2000
Location: Enschede, The Netherlands
Posts: 1,527 Mirax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 49 m 2 sec
Reputation Power: 10
Quote:
Originally posted by Targaz
Comment anybody?
No redundant information...
Looks fine to me
Quote:
Always happy to help someone who playes Kolonisten van Catan.
Hehe, indeed! It's a great game IMO. I was wondering though if it existed in the USA or Australia as well since I have some relatives who never heard of it before (original name would be Die Siedler von Catan (german) I think)
__________________
There are 10 types of people in this world - those who understand binary and those who don't...

PHP | MySQL | DevShed Forum Search | Google Search

Reply With Quote
  #7  
Old June 10th, 2003, 10:44 AM
Targaz's Avatar
Targaz Targaz is offline
I played Richard the Third
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Den Haag, Netherlands
Posts: 122 Targaz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I don't think it exists outside europe. Did anyone ever play the computerversion ? That is some sad software. The game is somewhat altered, but they translated from German to Dutch by some who has obviously never done that before.

Above that the IA-players are the most anyoing thing I have ever seen in my life in a computergame.

Since when do people in Enschede have acces to the internet?

Reply With Quote
  #8  
Old June 10th, 2003, 10:57 AM
Mirax's Avatar
Mirax Mirax is offline
Senior Member
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2000
Location: Enschede, The Netherlands
Posts: 1,527 Mirax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 49 m 2 sec
Reputation Power: 10
Quote:
Originally posted by Targaz
I don't think it exists outside europe.
Bah, then I'll have to export it
Quote:
Did anyone ever play the computerversion? That is some sad software. The game is somewhat altered, but they translated from German to Dutch by some who has obviously never done that before.

Above that the IA-players are the most anyoing thing I have ever seen in my life in a computergame.
Yup, I played it and found it not that bad though, although I must admit the Dutch isn't very great and the AI-players are a pain in the *ss (that's why I turn their speach of the moment I start ) a game... still prefer the boardgame though since it's much nicer to have some heated discussions with friends when they block my streets or resources etc..
Quote:
Since when do people in Enschede have acces to the internet?
Ohh, not that long, I switched from smoke signals as my main tool of communication to the internet only last month

Sigh... people from the randstad

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > help needed with design db


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway