Game database- many to many relationship

database-design

I am designing a simple relational database about a game that can be played by 2 players each

time. I have these tables: Player, Game, PlayerPlaysGame, Payment. I recognize there is a

many-to-many relationship between Player and Game and one-to-many between Player and Payment

since one player can make many payments whereby one payment can't be made by more than one

player. In PlayerPlaysGame table I have only playerID and gameID attributes. Can I also add

gameDate and gameScore to that table or is it better to have them in Game table?

I'd like to ask if I'm on the right track.

Thank you.

Best Answer

Yes, I believe you are on the right track. The gameDate and gameScore fields are more a part of the game entity and not the player, so they should be on the Gametable. Besides, bridge tables should really only contain the related ID fields.

If gameDate and gameScore were on the PlayerPlaysGame table, they would only be dependent on the gameID and not the playerID. By definition, this would constitute a partial dependency, and would violate second normal form.