Skip to content

About

Relational database in MySQL for managing tennis & padel players, courts, and matches. UFV Data Engineering final project.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tennis & Padel Match Management Database

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.

Entity-relationship diagram of the tennis & padel database

Overview

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.

Tech stack

  • MySQL 8.x — relational database engine
  • MySQL Workbench — schema design and ER modeling (diagrams/data_model.mwb)

Data model

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

Logical model

The logical ER diagram is shown at the top of this README and saved as diagrams/er_diagram.png.

Physical model (MySQL Workbench)

The physical schema, generated from the MySQL Workbench source file (diagrams/data_model.mwb):

Physical data model rendered from MySQL Workbench

Repository structure

.
├── 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

Getting started

Prerequisites

  • MySQL 8.0 or later
  • (Optional) MySQL Workbench to open the .mwb model

Run the scripts

# 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.sql

Analytical queries

scripts/03_queries.sql answers seven business questions:

  1. Player skill level computed as wins in the last year, grouped by sport.
  2. Tennis players registered in 2023.
  3. The month of the year with the highest match count.
  4. Player ranking by win percentage, including skill level.
  5. Player(s) with the maximum skill level.
  6. Players who practice more than one sport.
  7. Match counts broken down by sport and province.

Documentation

The full write-up of requirements, design decisions, and conclusions is in docs/final_report.pdf.

Author

Alejandro Magdiel Muñiz Corona — Master in Data Analytics, Universidad Francisco de Vitoria (UFV).

License

Released under the MIT License.

About

Relational database in MySQL for managing tennis & padel players, courts, and matches. UFV Data Engineering final project.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors