I want to create a database for soccer scores.
Obviously, we have:
- Países (Netherlands, Germany, (But also Europe))
- Competiciones (Eredivisie, Bundesliga, UEFA Europa League)
- Equipos (FC Twente, Bayern Munchen, Atletico Madrid)
- JUGADORES (Luuk de Jong, Manuel Neuer, Tiago Mendes)
- Cerillas (FC Twente - PSV, Bayern - Leverkusen, etc)
- Eventos (Goal scored in 40th minute by Luuk de Jong)
I'm using Dezign in which I have created the scheme below:
Obviously, a Competition is bound to a Country, a Player to a Team, etc.
But then some problems occur. An Event belongs to a Match and a Player. So the Event could get a
match_id y un
player_id. But then any player of any team could 'score' in a match in which he doesn't belong (A player of team C could score in a match between team A and team B). How can I restrict this for example?
Also, a Team could compete in its 'normal' competition, but also in the Champions League. Thus, a simple competition_id in the Team entity would not suffice.
And do you suggest any other thoughts?
Edit in response to Philipp
preguntado el 09 de marzo de 12 a las 14:03
You lack an entity to express the
Lineup(team, match) junto con una
LineupPosition (lineup, player).
You could then associate an
Event con un
LineupPosition (specific player in a specific match), thereby linking your
Event a la correcta
Match, a través de