Let’s say we have a Player table and a Team table and one-to-many relationship between them (a Player is a member of one Team only or a member of none)
So I have a nullable team_id field in Player table, referencing to a Team table.
But now I have to store an extra information about a player’s position in the team. Like:
isCaptainnumber- etc…
What is the right (normal) way to implement this?
My best ideas is an extra table:
Player one-to-one (NULL) PlayerTeam many-to-one (not NULL) Team
I would recommend your own suggestion making a new table:
and then make player_id unique, and team_id not null.
This will keep the player table clean and your database normalized.