I am making a database plan, and I am a little confused on Normalising to the Second Normal Form. I am also worried about the large number of columns, and I can't rightly figure out what to do with them.
This is my Table that I am focusing on MatchDetails
:
Idea 1
The Player_ID
is a Unique Primary Key for another table Users
. MatchID
is a Unique Primary Key for the table Matches
. The relationship between Matches and Players is many to many.
Would this work as a compound key? In the sense that 1 player can only have taken part in a particular Match once? Do the columns to the right of MatchID
Have a functional dependency on the Compound key, in the sense that they are unique TO that Compound key?
Idea 2
In this example, the Participation_ID
is a Unique Primary Key for the table, since there can be multiple instances of the same Player_ID
and the same MatchID
for various combinations of Players and Matches.
In this example, I would guess that this column is in Second Normal Form because there is only one Primary Key, and the Match Values are unique, and are thus functionally dependent? I am a little confused on Functional Dependency despite trying to read about it here.
Oh and another small thing...
The final thing that I am a little in doubt about, is the huge number of columns. All of the information to the right of MatchID
are details about HOW the player (Player_ID
) performed in the match (MatchID
). Should they be in another table?
Link to other tables if you would like to see the layout so far: https://i.stack.imgur.com/5GIUG.png
Please ignore that MatchID doesn't have an underscore and the other ID's do, It's only an excel plan!