AISSCE 2025-26
COMPUTER SCIENCE
PROJECT
“GYM MEMBERSHIP”
TRACKER
MY SQL & PYTHON
Submitted to :- Mr. MV SIR
Submitted by :- TEJAS GARG
XII-A
2
1
Tejas garg,2 XII-A
How Python & MySQL are Used:
This project makes use of Python as the front-
end programming language and MySQL as the
back-end database. Python handles all the
logic, user inputs, and interface through a
simple command-line menu. It uses the
[Link] module to connect to the
MySQL server and perform database operations
such as inserting new records, updating plans,
deleting members, and retrieving data. All the
gym member information is stored in a MySQL
table, ensuring data is organized and
persistent.
The use of MySQL allows for reliable storage
and quick searching of member records, while
Python enables interactive, real-time input and
output, making the entire system efficient, easy
to use, and scalable.
2
WHY “GYM MEMBERSHIP TRACKER” ?
In today's fast-paced world, gyms and fitness
centers play an important role in promoting a
h e a l t h y l i f e s t y l e . H o w e v e r, m a n a g i n g g y m
member records, memberships,
and renewals manually can
be time-consuming and
error-prone. This project,
“Gym Membership Tracker”,
is a Python-based software
solution designed to Automate
the day-to-day tasksof managing
gym memberships efficiently using MySQL as the
backend database.
The project allows the gym staff to store and
manage all member details including name, age,
g e n d e r, p h o n e n u m b e r, s e l e c t e d m e m b e r s h i p
plan, start and end dates of membership. It also
provides functionalities to update existing
member details, delete records, search specific
members, and track which memberships are
about to expire — all through a user-friendly
command-line interface.
This system simplifies gym operations, reduces
manual work, and ensures that important details
like expiring memberships are never missed. It
also helps in keeping accurate and organized
records.
3
Process to
make “Gym Membership Tracker”
PART1 MySQL Database Structure:-
STEP1 opening MySQL:-
● type MySQL Command Line Client.
In home search bar and open it.
● Login using your MySQL credentials.
● Press Enter.
STEP2 create the Database:-
● Enter the following command:- create database gym;
● Then press enter.
● Database named “gym” is created.
● Then type command:- use gym;
● Then press enter.
● 'gym' database is now active.
4
STEP3 create table 'members':-
● To create table “members” type the following command--
● Then press enter . Table named 'members' is created.
● This table includes fields for:-
●
● member_id: Unique ID for each member
● name, age, gender, phone: Basic personal info
● plan: Membership plan (Monthly, Quarterly, Yearly)
● start_date, end_date: Plan duration tracking
●
STEP4 confirm creation of table:-
●
● To verify wether table is created type the command:- show tables:
and press enter.
● The follwing image will appear showing name of tables in
existing in gym database.
5
STEP5 Checking structure of table:-
● To see table structure type command:- desc members;
and press enter.
● The follwing table will appear showing the structure of table
which include field name, data type etc.
In MySQL 'gym' databse is created with table 'members' in it.
PART2 install mysql-connector-python:-
Mysql-connector-python is installed to connect mysql to python
[Link] that code can be written to use table in databse in mysql.
STEP1 open command prompt:-
● Press Win + R>type cmd>press enter.
● Command prompt is opened. 6
STEP2 Install the MySQL Connector module:-
● Type the following command in command prompt
pip install mysql-connector-python
● press enter.
● Download will began.
● After few seconds download will finish and the following
statement will be displayed
“successfully installed mysql-connector-python” see image1.1
● Then close the window.
Image1.1
PART3 setting up python idle:-
setting up python idle means entering all the command required to
make 'GYM MEMBERSHIP TRACKER' . Open python idle and the
follow the following steps:-
STEP1 import required modules:-
● Enter the following command:- import [Link]
● Press enter .
● Now enter next command:- from datetime import date, timedelta
● Press enter.
● Mysql connector will help python to connect with my sql
● datetime helps calculate plan durations like monthly, yearly, etc.
7
STEP2 connect to the mysql database:-
● Type the follwing command shown in the image and enter your
mysql user id and password and databse name for this 'gym'
● Then press enter
**User and password are hidden for safety**
● Now enter a second command:- cursor = [Link]()
● Then press enter.
● These commands help to establish a connection to mysql
database named 'gym'
STEP3 Function to add a new member:-
● Enter the command displayed on next page 9 image1.2.
● Then press enter
● This command takes member details.
● Calculates plan duration.
● Then save the enter the record into members table.
8
Image1.2
STEP4 function to view all members:-
● Enter the following command in following image and press enter
9
STEP5 function to update membership plan:-
● Enter the following command
● Lets you update a member's membership plan
STEP6 Function to delete a member:-
● Enter the following command
10
STEP7 function to search a member:-
● Enter the following command
STEP8 Function to show expiring memberships:-
● Enter the following command
11
STEP9 menu loop to use all functions:-
● Enter the following command
STEP10 Start the program:-
● Enter the following command:- menu()
● Press enter.
“GYM MEMBERSHIP TRACKER” is ready 12
●
RESULTS
When menu() command is entered in python idle the follwing
menu will appear.
● The following menu will give us 7 options:-
● 1) Add new member:-
● whenever 1 is typed in enter your choice the system wil ask us
for person's name,age,gender,phone number,[Link] image1.3
● Insert the required details. And hence a record is created.
● A message will be displayed “member added successfully!'
Image1.3
13
2) view all members:-
● This option will help us to see all the members in the records.
● So just type 2 in enter your choice to access this option.
● Following example can be seen
3) update membership plan:-
● This option will help us to update the plan of a member.
● Whenever 3 is typed the system will ask for member id of
[Link] updated plan.
● Following example can be seen.
14
4) delete member:-
● This option can be used to delete a record of a member.
● When 4 is typed the system will ask for member id for which
data is to be deleted.
● Enter the id and the data for that member is deleted.
● Following example can be seen.
● Data for member id 2 will be deleted forever
5) search member:-
● This option can be used to search data of a member.
● The system will ask for either member id or member name.
● Enter either of the detail and the whole data for that member
will appear.
● Following example can be seen
15
6) Show Expiring Memberships:-
● This option is used to check if membership expiring of any
member.
● The following example can be seen
7) exit:-
● This option is used to exit the loop of menu().
16