Reputation: 13
Essentially, what I want to do, is keep track of different game scores across players and matches. I think the db should start with the match table, that links to a player table, as well as a game table. what i can't figure out is where to put the scores table because it's not just a single type of score, we're talking dozens of iterations of scoretypes, sometimes money is called gold, or credits, other times, there's a money score, but also a victory point score added in as well.
i think there's two ways of doing this. making a gamescoretype table that includes all score types possible. or i was thinking a different table for each board game's score types
flow of information would be
I'd want all data to be able to be linked to matches or players for statistical purposes. Any ideas? I've posted a mockup of what i think could work
Upvotes: 1
Views: 2027
Reputation: 7344
Anytime you have a table with columnA1, columnA2, columnA3 etc you are probably going in the wrong direction. This applies to the Score table above. It breaks the rules of Normal Forms, by having what is known as Repeating Groups. Look up Third Normal Form (3NF) which should be your guide to designing databases.
Change ScoreType to be:
ScoreTypeId int
ScoreTypeName varchar(50)
In Score, only have one ScoreField and add a ScoreTypeId. then for each game etc you can have multiple types of score.
Upvotes: 1