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

01-28-11, 08:51
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Cape Town, South Africa
Posts: 57
|
|
|
Events, tournaments, matches, & games (teams or single/multiple players as opponents)
|
|
Hello,
This is driving me crazy. I can't quite figure out how to model this data.
The domain is computer gaming.
The easy part is one Event has many Tournaments has many Matches. The difficult part is the matches/games and opponents.
Each match has 1 or more games, and each game can be played 1-on-1, 2-on-2, etc. (i.e. 2 players from one team vs 2 from the other), or Team vs Team.
Here are some examples from another site:
Player vs Player: SK Gaming - Esports, Professional Gaming, Counter-Strike, Warcraft III, World of Warcraft, FIFA, DotA, Starcraft, Quake, Console
Team vs Team: SK Gaming - Esports, Professional Gaming, Counter-Strike, Warcraft III, World of Warcraft, FIFA, DotA, Starcraft, Quake, Console
Team Players vs Team Players: SK Gaming - Esports, Professional Gaming, Counter-Strike, Warcraft III, World of Warcraft, FIFA, DotA, Starcraft, Quake, Console
It's also necessary to know (in the last case), which two teams are playing each other.
You can assume player and team tables with ids and names.
Any ideas?
|
|

01-28-11, 10:09
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
|
|
I'd load both players and teams into the same table. You can separate them logically using dedicated views, but this allows either a player or a team to be assigned to game.
And of course, a player can be assigned to a team.
This is the process of creating a physical schema from a logical design. The two do not always match one-for-one.
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

01-28-11, 10:28
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Cape Town, South Africa
Posts: 57
|
|
|
|
Hi Blindman,
Is that the only option? Also, what about when a game is 2 against 2, for example?
This is what I have so far ...
Code:
matches
id
tournament_id
start_date
match_games
id
match_id
winning_opponent_id
match_opponents
match_id
opponent_id
game_opponents
game_id
opponent_id
opponents
id
name (“Team 1” or “Player 1”)
_da.
|
|

01-28-11, 11:23
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
|
|
Its the best option.
When a game is 2 on 2, why not form them into teams of 2?
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

01-28-11, 12:00
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Cape Town, South Africa
Posts: 57
|
|
It's 2-on-2, but they're a part of bigger teams (see SK Gaming - Esports, Professional Gaming, Counter-Strike, Warcraft III, World of Warcraft, FIFA, DotA, Starcraft, Quake, Console)
_da.
|
|

01-31-11, 11:01
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
|
|
You mean they are part of larger "clans"?
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

02-02-11, 02:26
|
|
Super Moderator
|
|
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
|
|
There's a many-to-many relationship between teams and players?
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert
|
|

02-02-11, 02:50
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Cape Town, South Africa
Posts: 57
|
|
Quote:
Originally Posted by blindman
You mean they are part of larger "clans"?
|
Yes. ..........
|
|

02-02-11, 02:52
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Cape Town, South Africa
Posts: 57
|
|
Quote:
Originally Posted by loquin
There's a many-to-many relationship between teams and players?
|
Yes. ..........
|
|

02-02-11, 02:55
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Cape Town, South Africa
Posts: 57
|
|
I'm thinking of doing something like this with the opponents ( Class Table Inheritance):
Code:
game_opponents
game_id
opponent_id
opponents
id
type (Player / Team / TeamPlayer)
players
id (Linked to opponents.id)
name
teams
id (Linked to opponents.id)
name
is_national_team
team_players
id (Linked to opponents.id)
team_id
player_id
date_from
date_to
_da.
|
|

02-02-11, 11:33
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
|
|
Well, there is more than one way to skin a cat, but I've already told you that I do not recommend that approach.
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

02-02-11, 14:27
|
|
Purveyor of Discontent
|
|
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
|
|
That's what the business logic in your application is for. You were close with the model before. blindman was pointing out that you were trying to assign two different meanings to the word/entity "team". Introduce the concept of a clan. Teams and clans are both comprised of players, but they are very different things in the real world.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|