|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I would like to get your opinion on the following build of my db. Its made to contain statistics from sportsgames. The teamstats + individual stats have to be saved in it for every match. This is how it looks right now:
tblteams: teamID (general team data) tblplayers: playerID - teamID (general player data) tblmatches: matchID - teamID1 - teamID2 (team totals from the matches teamID1 vs teamID2) tblstats: statsID - playerID - matchID (stats from one player on one specific match) I'm having the following problem: - Players change teams, this is not a big problem if you change the teamID of the player. The problem is that the players stats history becomes messed up. Then all his former stats will appear as if he played always for his new team. So if player x played in 2004 for team y then you have to see that on the 2004 statistics page even if he now plays for team z. Because of that i thought to add a new field to tblplayers and this table would like like this: tblplayers: playerID - teamID0405 - teamID0506 - teamID0607 - ... This system looked good at first sight untill I was thinking that players can change teams within one season. Because of this teamID0506 could be teamx and change that same year too teamy. So the above doesnt work. Is there someone with a better solution? If you see other problems arising feel free to tell me them. I rather work now on my db for some longer then have a big mess within 3 months. One solution i thought about was making a table for every team every year like: tblteamx0607: playerID tblteamx0708: playerID tblteamy0708: playerID I don't know if this is a good solution and even from a db designers viewpoint 'legit'. thx in advance for your help |
|
#2
|
|||
|
|||
|
I think I found a solution:
adding the field teamID to the tblstats makes it possible to know for what team the stats where made, tracking this togheter with a date makes it possible to know in what seasons that was done |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Database Development > Problem with my db design |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|