MasterRacker
New member
I'm beginning design of a league management package. I may be getting senile, but I seem to be having difficulty with my "Games" table.
In simplified form, I need to track 2 players, what each scored and who won for each game. (There's more to it obviously, but this will illustrate my mental block.) I've come up with two scenarios for table design:
Option A:
GameID, Player1ID, Player1Scored, Player2ID, Player2Scored, WinnerID
Option B
GameID, PlayerID, OpponentID, PlayerScored, PlayerAllowed, PlayerWon
Now, lets look at the simple scenario of trying to find out Jeff's total points scored for the season:
In Option A, my query has to look for JeffsID=Player1ID OR JeffsID=Player2ID and then total either of the respective scored columns. To me, that seems messy.
In Option B, the queries are straightforward, but each game ends up appearing twice. Ex. One entry with me as the player and also a "mirrored" entry with my opponent as the player and me as the opponent.
Because I'm having this issue at all, I suspect I don't have my data normalized completely, but I don't know what else to do here. Any suggestions?
_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
In simplified form, I need to track 2 players, what each scored and who won for each game. (There's more to it obviously, but this will illustrate my mental block.) I've come up with two scenarios for table design:
Option A:
GameID, Player1ID, Player1Scored, Player2ID, Player2Scored, WinnerID
Option B
GameID, PlayerID, OpponentID, PlayerScored, PlayerAllowed, PlayerWon
Now, lets look at the simple scenario of trying to find out Jeff's total points scored for the season:
In Option A, my query has to look for JeffsID=Player1ID OR JeffsID=Player2ID and then total either of the respective scored columns. To me, that seems messy.
In Option B, the queries are straightforward, but each game ends up appearing twice. Ex. One entry with me as the player and also a "mirrored" entry with my opponent as the player and me as the opponent.
Because I'm having this issue at all, I suspect I don't have my data normalized completely, but I don't know what else to do here. Any suggestions?
_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]