A relational database designed in MySQL to manage players, facilities, courts, matches, and results for tennis and padel clubs across Spanish provinces. Built as the final project for the Data Engineering module of the UFV Master's in Data Analytics.
The system models a sports management platform that tracks:
- Facilities and courts distributed across Spanish provinces, with court type (indoor/outdoor) and surface material.
- Players with personal data, registration date, province, and subscription tier.
- Matches played on specific courts for a given sport (tennis or padel) on a given date.
- Results linking each player to each match they played, with a 0/1 win flag.
- Player skill level per sport, on a 1.0–7.0 scale.
The schema enforces referential integrity through foreign keys and uses CHECK constraints to validate result values and skill ranges.
- MySQL 8.x — relational database engine
- MySQL Workbench — schema design and ER modeling (
diagrams/data_model.mwb)
The database contains 11 tables:
| Table | Purpose |
|---|---|
Provincias |
Spanish provinces (Madrid, Barcelona, …) |
Instalaciones |
Sports facilities, located in a province |
Tipos_pistas |
Court types and surface materials |
Tipo_deporte |
Sport categories (racket sports, …) |
Deporte |
Specific sports (Tennis, Padel) |
Pistas |
Individual courts with price, type, facility, sport |
Tipos_suscripciones |
Subscription tiers and pricing |
Jugadores |
Players with address, registration date, subscription |
Partidos |
Matches with date, court, sport |
Resultados |
Per-player match outcomes (win/loss) |
Nivel_jugadores |
Per-sport skill level per player |
The logical ER diagram is shown at the top of this README and saved as diagrams/er_diagram.png.
The physical schema, generated from the MySQL Workbench source file (diagrams/data_model.mwb):
.
├── scripts/
│ ├── 01_create_tables.sql # DDL — schema definition
│ ├── 02_insert_data.sql # Sample seed data
│ └── 03_queries.sql # Analytical queries
├── diagrams/
│ ├── er_diagram.png # Logical ER diagram
│ ├── physical_model.png # Physical schema (MySQL Workbench export)
│ └── data_model.mwb # MySQL Workbench source
├── docs/
│ ├── final_report.pdf # Full project report
│ ├── final_report.docx
│ ├── logical_model.pdf # Logical data model
│ └── physical_model.pdf # Physical data model
├── README.md
└── LICENSE
- MySQL 8.0 or later
- (Optional) MySQL Workbench to open the
.mwbmodel
# 1. Create a database
mysql -u root -p -e "CREATE DATABASE tenis_padel; USE tenis_padel;"
# 2. Build the schema
mysql -u root -p tenis_padel < scripts/01_create_tables.sql
# 3. Load sample data
mysql -u root -p tenis_padel < scripts/02_insert_data.sql
# 4. Run the analytical queries
mysql -u root -p tenis_padel < scripts/03_queries.sqlscripts/03_queries.sql answers seven business questions:
- Player skill level computed as wins in the last year, grouped by sport.
- Tennis players registered in 2023.
- The month of the year with the highest match count.
- Player ranking by win percentage, including skill level.
- Player(s) with the maximum skill level.
- Players who practice more than one sport.
- Match counts broken down by sport and province.
The full write-up of requirements, design decisions, and conclusions is in docs/final_report.pdf.
Alejandro Magdiel Muñiz Corona — Master in Data Analytics, Universidad Francisco de Vitoria (UFV).
Released under the MIT License.

