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/1/2021 上午9:05 |
Seen: 1392 times |
Last updated: 6/8/2021 上午10:49 |