
π Sports & Fitness Β· Database ERD
A schema for a sports league: teams, players, squads per season, matches, match events and player statistics.
Drawing diagramβ¦
ERD for a sports league: Season has Teams through SquadMemberships of Players; Match is between a home Team and an away Team at a Venue in a Season; MatchEvent records each event (goal, card, substitution, wicket) with minute and player; PlayerStat aggregates appearances and goals per player per season.
erDiagram
SEASON ||--o{ MATCH : schedules
TEAM ||--o{ SQUAD_MEMBERSHIP : fields
PLAYER ||--o{ SQUAD_MEMBERSHIP : "plays for"
SEASON ||--o{ SQUAD_MEMBERSHIP : "valid in"
VENUE ||--o{ MATCH : hosts
MATCH ||--o{ MATCH_EVENT : records
PLAYER ||--o{ MATCH_EVENT : involved
PLAYER ||--o{ PLAYER_STAT : "summarised in"
MATCH {
int id PK
int season_id FK
int home_team_id FK
int away_team_id FK
int venue_id FK
datetime kickoff
}
MATCH_EVENT {
int id PK
int match_id FK
int player_id FK
string type
int minute
}
PLAYER_STAT {
int player_id FK
int season_id FK
int appearances
int goals
}How live scores reach millions of fans within a second: official scorers, the data feed, stream processing, caching and push notifications.
Where each part of a fitness tracking product runs: the wearable, the phone app that syncs it, and the cloud services for workouts, goals and coaching.
A platform to run an amateur or professional league: team registration, fixtures, match scoring, standings and fan apps.
How a fan books tickets for a big match: queue, seat selection with a temporary hold, payment and a mobile ticket with QR code.
A timeline for organising a multi-team tournament: registrations, league stage, knockouts, final and the work around it.
The states of a gym membership: trial, active, frozen, expiring, renewed, lapsed and cancelled.