Welcome!
This community is for professionals and enthusiasts of the Genio platform.
Share your questions and challenges, and help your partners!
TABLES: Automatically update record
I have 2 tables: players and teams. I assumed the relation between them is n:1 (foreign key inside player's table).
I want to be able to record all the teams the player has played.
What should I do?
In this case, it might be easier to create a n:n relation between players and teams. You can create an extra table that has 3 fields: The foreign key to player, the foreign key to team and an extra field to indicate if that is the current team of the player. For example, you could store the date that the player joined that team, and the team with the latest join date would be the player current team. This would both help you to track all the teams that the player played in, and also check his current team. From the teams perspective, you would look at the extra table and filter each player by only his latest join team (same as aforementioned) and would then count/check all the players which their latest team would be the team in question, and you could check the roster.
Keep Informed
About the Community
Question tools
Stats
Asked: 12/01/2021 09:05 |
Seen: 1383 times |
Last updated: 06/08/2021 10:49 |