I’m designing a database with three tables: user, game and (probably) register. I want to represent that a user can be registered on zero or more games.
I use table register to register a user in a game.
I also need to store the score of the user in a game.
My question is:
Can I add a column called score in table register? Is it a good design?
Thanks.
What you’re describing is a many-to-many relationship, using REGISTER as the cross-reference table:
Sounds okay, though if either game-related or registration-related info gets more complicated you’ll probably split it in two eventually.
Edited to add: Often you’ll end up wanting to save game history (“average score”, “last 5 games”, “fastest time”, etcetera). Then you have a one-to-many relationship between
REGISTERand aGAME_HISTORYtable.Also, I agree with the answer that said calling it a ‘registration’ table will be confusing if it contains non-registration info.