Skip to content

Analysis of data from a fictitious gym system in the city of São Paulo, with the purpose of studying and identifying patterns and behaviors regarding student attendance at the gym, finances, their characteristics, among others.

Notifications You must be signed in to change notification settings

gioferracini/Gym-Data-Analysis-Using-SQL

Repository files navigation

🏋 Gym Management Analytics — SQL Project

This project simulates a gym management system, using SQL to explore and extract strategic business insights from a relational database.
A total of 23 analytical SQL scripts were developed, covering areas such as financial health, customer profiles, product sales, instructor allocation, and more.

All data are fictitious and intended purely for portfolio and learning purposes.


🧠 Key Skills Demonstrated

  • SQL (CTEs, joins, aggregations, window functions)
  • Data modeling & KPIs
  • Analytical reasoning and business storytelling
  • Realistic simulation of a gym operational database

🗃️ Database Structure

The project uses the following main tables (available in .sql or .csv format):

  • alunos (students): personal data, age, neighborhood, registration and status
  • planos (membership plans): plan details and prices
  • pagamentos (payments): student payments, status, and payment method
  • modalidades (activities): list of activities offered (muscle training, cardio, pilates, etc.)
  • frequencia (attendance): daily logs of student presence by activity
  • produtos (products): supplements, apparel, accessories
  • vendas_produtos (product sales): transactions with quantities and values
  • professores (instructors): personal data, profile and salary
  • professor_modalidade (which instructor teaches which activity)
  • despesas & pagamentos_despesas: operational costs (rent, maintenance, energy)

📑 Developed Scripts

📈 Business Evolution

  1. Annual evolution of total costs (payroll + expenses)
  2. Annual evolution of total revenues (memberships + product sales)
  3. Annual evolution of new enrollments
  4. Accumulated revenue by year
  5. Accumulated costs by year
  6. Product sales evolution over time

👥 Customer Profile and Behavior

  1. Most frequent gender in attendance
  2. Frequency comparison by age group
  3. Most represented neighborhoods
  4. Average ticket by student
  5. Average ticket by neighborhood

🏋 Gym Usage Patterns

  1. Most crowded periods (morning, afternoon, evening)
  2. Most crowded days of the week
  3. Most practiced activities
  4. Average ticket by activity
  5. Most sold products

💰 Financial and Strategy

  1. Costs vs. revenues comparison
  2. Highest-paid instructors (overall)
  3. Highest-paid instructors by activity
  4. Membership distribution by plan
  5. Revenue share by plan
  6. Most common payment methods
  7. Instructors teaching more than one activity

🛠️ Tools Used

  • SQL (MySQL)
  • MySQL Workbench (or any RDBMS client)

🗃️ Files

/1 - Business Evolution – 6 SQL scripts (.sql format)

/2 - Customer Profile – 5 SQL scripts (.sql format)

/3 - Gym Usage Patterns – 5 SQL scripts (.sql format)

/4 - Financials & Strategy – 7 SQL scripts (.sql format)

/5 - Database – Tables in SQL or CSV format

README.md – Project documentation


🚀 How to Use

  • Clone this repository
  • Import the database into your favorite RDBMS (like MySQL)
  • Run the SQL scripts to explore the insights
  • Feel free to adapt queries or use them in your portfolio

📌 Important Notes

This dataset was entirely generated with Python and does not reflect real people or businesses.

Several queries use advanced SQL features like:

  • CTEs (WITH)
  • window functions (ROW_NUMBER())
  • date functions (DATE_FORMAT, DATEDIFF)

📬 Contact


⭐ If you found this analysis useful or insightful, feel free to star the repository!

About

Analysis of data from a fictitious gym system in the city of São Paulo, with the purpose of studying and identifying patterns and behaviors regarding student attendance at the gym, finances, their characteristics, among others.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published