0% found this document useful (0 votes)
3 views35 pages

Class XII CSC Gym Program

The Gym Database Management System is designed to streamline gym operations with features for member management, class scheduling, and analytics. It utilizes Python for programming and MySQL for data management, offering a user-friendly interface and robust functionality. The document includes details on system configuration, source code, and output examples demonstrating its capabilities.

Uploaded by

sanjaysajivkumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views35 pages

Class XII CSC Gym Program

The Gym Database Management System is designed to streamline gym operations with features for member management, class scheduling, and analytics. It utilizes Python for programming and MySQL for data management, offering a user-friendly interface and robust functionality. The document includes details on system configuration, source code, and output examples demonstrating its capabilities.

Uploaded by

sanjaysajivkumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

GYM DATABASE

MANAGEMENT
SYSTEM
TABLE OF CONTENTS
1. Project Description
2. Glimpses of Python
3. Glimpses of MySQL
4. Hardware and Software Configuration
5. Tables in the Database
6. Source Code
7. Output
8. Bibliography
PROJECT DESCRIPTION
Our Gym Database Management System is a powerful tool designed to simplify
gym operations. Built with a user-friendly front-end and a robust MySQL backend, it
offers:
1. Member Management: Store member details and memberships.

2. Membership Handling: Register new members

3. Class and Staff Management: Schedule classes, manage trainers, and oversee
staff schedules.

4. Analytics: Generate reports for attendance.

Simplify gym administration, enhance member experiences, and make data-driven


decisions with our Gym Database Management System.
GLIMPSES OF PYTHON
• Python is a high-level, general-purpose, self-
contained programming language designed to meet the
needs of computer scientists, software developers and
college students interested in coding.

• Python was created in the early 1980s by Guido van Rossum.

• Python is a high-level, interpreted, dynamic object-


oriented programming language that can be used to
program applications or websites.

• It is also known as an object-oriented


programming (OOP) language. The main benefits of
using Python instead of other
languages are that it is very easy to start programming with
and because of its flexible syntax, it can be used to program
almost any kind of software application.

• Python is an open-source language that’s free to use and has a


wide range of features that make it easy to customize.
PYTHON FEATURES AND ADVANTAGES
• Easy to Code. Python is a very high-level programming

language, Yet it is effortless to learn

• Easy to Read. Python code looks like simple English words.

• Free and Open-Source.

• Robust Standard Library.

• Interpreted.

• Portable.

• Object-Oriented and Procedure-Oriented.

• Extensible.
GLIMPSES OF MYSQL
MySQL is a system that helps to store and manage data
efficiently. Database generally stores data in a structured
fashion.

SALIENT FEATURES OF MYSQL


Quick and Reliable
MySQL stores data efficiently in the memory ensuring that data is
consistent, and not redundant. Hence, data access and
manipulation using MySQL is quick.

Free to download
MySQL is free to use so that we can download it from MySQL
official website without any cost.
Scalable
Scalability refers to the ability of systems to work easily with
small amounts of data, large amounts of data, clusters of
machines, and so on. MySQL server was developed to work with
large databases.
Data Types
It contains multiple data types such as unsigned integers, signed
integers, float (FLOAT), double (DOUBLE), character (CHAR),
variable character (VARCHAR), text, blob, date, time, datetime,
timestamp, year, and so on.
Secure
It provides a secure interface since it has a password system
which is flexible, and ensures that it is verified based on the host
before accessing the database. The password is encrypted while
connecting to the server.
Client and Utility Programs
MySQL server also comes with many client and utility programs.
This includes Command line programs such as ‘mysqladmin’ and
graphical programs such as ‘MySQL Workbench’. MySQL client
programs are written
in a variety of languages. Client library (code encapsulated in a
module) can be written in C or C++ and would be available for
clients that have C bindings.

Compatible on many operating systems


MySQL is compatible to run on many operating systems, like
Novell NetWare, Windows* Linux*, many varieties of UNIX* (such
as Sun*Solaris*, AIX, and DEC* UNIX), OS/2, FreeBSD*, and
others. MySQL also provides a facility that the clients can run on
the same computer as the server or on another computer
(communication via a local network or the Internet).
Support for large databases
MySQL has no limit on the number of databases. The underlying
filesystem may have a limit on the number of [Link]
has no limit on the number of tables. The underlying file system
may have a limit on the number of files that represent tables.
Individual storage engines may impose engine-specific
constraints. InnoDB permits up to 4 billion tables.
GUI Support
MySQL provides a unified visual database graphical user interface
tool named "MySQL Workbench" to work with database
architects, developers, and Database Administrators.
HARDWARE AND
SOFTWARE
CONFIGURATION
HARDWARE
• Operating System : Windows 10 or above

• Processor : Pentium 2.6GHz

• RAM : 4GB

• HardDisK : SSD 128GB

SOFTWARE

• Windows OS

• Python 3.8 or above

• MySQL 8.0 Command Line Client


TABLES IN
THE
DATABASE
SOURCE CODE
import [Link] as ms

myobj=[Link](host="localhost",user="root",password="Sanjay123*",
database="Gym")

mycus=[Link]()

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------------------

def insert():

global myobj,mycus

a_choice=int(input("""Enter the choice

[Link] Member details

[Link] Trainer details

[Link]

Enter="""))

if a_choice==1:

mem_id=int(input("Enter member id"))

mem_name=input("Enter member name")


mem_no_1=int(input("Enter member contact number"))

mem_no_2=int(input("Enter member alternate contact number"))

address=input("Enter member eMail address")

pass_=input("Enter member pass")

train_id=int(input("Enter member\'s trainer id"))

doj=input("Enter member date of join")

attendance=input("Enter the member\'s attendance")

query_a="insert into members values({},'{}',{},{},'{}','{}','{}',


{},'{}')".format(mem_id,mem_name,mem_no_1,mem_no_2,address,pass_,
doj,train_id,attendance)

[Link](query_a)

[Link]()

elif a_choice==2:

t_id=int(input("Enter trainer id"))

t_name=input("Enter trainer name")

t_no_1=int(input("Enter trainer contact number"))

t_no_2=int(input("Enter trainer alternate contact number"))

salary=int(input("Enter trainer salary"))


shift_time=input("Enter trainer shift timings")

query_b="insert into trainer values({},'{}',{},{},


{},'{}')".format(t_id,t_name,salary,t_no_1,t_no_2,shift_time)

[Link](query_b)

[Link]()

elif a_choice==3:

print("Finished")

else:

print("Invalid choice")

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------

def show():

global myobj,mycus

b_choice=int(input("""Enter the choice

[Link] Member details

[Link] Trainer details

[Link]

enter="""))
if b_choice==1:

query_c="select * from members order by mem_id"

[Link](query_c)

data_c=[Link]()

for c in data_c:

print(c)

elif b_choice==2:

query_d="select * from trainer order by t_id"

[Link](query_d)

data_d=[Link]()

for d in data_d:

print(d)

elif b_choice==3:

print("Finished")

else:

print("Invalid Choice")

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------

def update():

global myobj,mycus

c_choice=int(input("""Enter the choice

[Link] Member details

[Link] Trainer details

[Link]

enter="""))

if c_choice==1:

c_a_choice=int(input("""Enter the choice

[Link] Member alternate contact number

[Link] Member membership pass

[Link] Member eMail address

[Link]

enter="""))

if c_a_choice==1:

new_no=int(input("Enter new contact number"))


m_id=int(input("Enter Member id"))

query_e="update members set cus_no_2={} where


mem_id={}".format(new_no,m_id)

[Link](query_e)

[Link]()

elif c_a_choice==2:

new_pass=input("Enter new membership pass")

m_id_1=int(input("Enter Member id"))

query_f="update members set pass='{}' where


mem_id={}".format(new_pass,m_id_1)

[Link](query_f)

[Link]()

elif c_a_choice==3:

new_address=input("Enter new eMail address")

m_id_2=int(input("Enter Member id"))

query_g="update members set mem_ads='{}' where


mem_id={}".format(new_address,m_id_2)

[Link](query_g)

[Link]()
elif c_a_choice==4:

print("Finished")

else:

print("Invalid choice")

elif c_choice==2:

c_b_choice=int(input("""Enter the choice

[Link] Trainer alternate contact number

[Link] Trainer salary

[Link] Trainer shift timings

[Link]

enter="""))

if c_b_choice==1:

new_no_1=int(input("Enter new contact number"))

t_id_1=int(input("Enter Trainer id"))

query_h="update trainer set t_no_2={} where


t_id={}".format(new_no_1,t_id_1)

[Link](query_h)

[Link]()
elif c_b_choice==2:

new_sal=int(input("Enter new salary"))

t_id_2=int(input("Enter Trainer id"))

query_i="update trainer set salary={} where


t_id={}".format(new_sal,t_id_2)

[Link](query_i)

[Link]()

elif c_b_choice==3:

new_timing=input("Enter new shift timings")

t_id_3=int(input("Enter Trainer id"))

query_j="update trainer set shift_time='{}' where


t_id={}".format(new_timing,t_id_3)

[Link](query_j)

[Link]()

elif c_b_choice==4:

print("Finished")

else:

print("Invalid choice")
elif c_choice==3:

print("Finished")

else:

print("Invalid choice")

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------

def delete():

global myobj,mycus

d_choice=int(input("""Enter the choice

[Link] Member details

[Link] Trainer details

[Link]

enter="""))

if d_choice==1:

m_id_3=int(input("Enter Member id"))

query_k="delete from members where mem_id={}".format(m_id_3)

[Link](query_k)
[Link]()

elif d_choice==2:

t_id_4=int(input("Enter Trainer id"))

query_l="delete from trainer where t_id={}".format(t_id_4)

[Link](query_l)

[Link]()

elif d_choice==3:

print("Finished")

else:

print("Invalid choice")

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------

def report():

global myobj,mycus

e_choice=int(input("""Enter the choice

[Link] Member report

[Link] Trainer report


[Link]

enter="""))

if e_choice==1:

m_id_4=int(input("Enter Member id"))

query_J="select
a.mem_name,a.cus_no_1,[Link],b.t_name,[Link] from members a,
trainer b where a.t_id=b.t_id and mem_id={}".format(m_id_4)

[Link](query_J)

data_J=[Link]()

for J in data_J:

print(J)

elif e_choice==2:

t_id_5=int(input("Enter Trainer id"))

query_K="select * from trainer where t_id={}".format(t_id_5)

[Link](query_K)

data_K=[Link]()

for K in data_K:

print(K)
elif d_choice==3:

print("Finished")

else:

print("Invalid choice")

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------

def search():

global myobj,mycus

f_choice=int(input("""Enter the choice

[Link] Member details

[Link] Trainer details

[Link]

enter="""))

if f_choice==1:

f_a_choice=int(input("""Enter the choice

[Link] Member details by Member\'s id

[Link] Member details by Member\'s contact number


[Link]

enter="""))

if f_a_choice==1:

m_id_5=int(input("Enter Member id"))

query_l="select * from members where


mem_id={}".format(m_id_5)

[Link](query_l)

data_l=[Link]()

print(data_l)

elif f_a_choice==2:

m_cus_no=int(input("Enter Member contact number"))

query_m="select * from members where cus_no_1={} or


cus_no_2={}".format(m_cus_no,m_cus_no)

[Link](query_m)

data_m=[Link]()

print(data_m)

elif f_a_choice==3:

print("Finished")
else:

print("Invalid choice")

elif f_choice==2:

f_b_choice=int(input("""Enter the choice

[Link] details by Trainer\'s id

[Link] Trainer details by Trainer\'s contact number

[Link]

enter="""))

if f_b_choice==1:

t_id_6=int(input("Enter Trainer id"))

query_n="select * from trainer where t_id={}".format(t_id_6)

[Link](query_n)

data_n=[Link]()

print(data_n)

elif f_b_choice==2:

t_mob_no=int(input("Enter Trainer contact number"))

query_o="select * from trainer where t_no_1={} or


t_no_2={}".format(t_mob_no,t_mob_no)
[Link](query_o)

data_o=[Link]()

print(data_o)

elif f_b_choice==3:

print("Finished")

else:

print("Invalid choice")

elif f_choice==3:

print("Finished")

else:

print("Invalid choice")

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------

def membership():

global myobj,mycus

pass_name=input("""Enter the pass name to view the membership


holder of selective plans

-Bronze
-Silver

-Gold

-Platinum

-Diamond

enter=""")

query_p="select * from members where pass='{}'".format(pass_name)

[Link](query_p)

data_p=[Link]()

for p in data_p:

print(p)

#--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------

while True:

choice=int(input("""Enter the choice

[Link] DATA

[Link] DATA

[Link] DATA
[Link] DATA

[Link]

[Link]

[Link] HOLDER

[Link]

enter="""))

if choice==1:

insert()

elif choice==2:

show()

elif choice==3:

update()

elif choice==4:

delete()

elif choice==5:

report()

elif choice==6:
search()

elif choice==7:

membership()

elif choice==8:

print("Finished")

break

else:

print('Invalid choice')

[Link]
OUTPUT
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=1
Enter the choice
[Link] Member details
[Link] Trainer details
[Link]
Enter=1
Enter member id105
Enter member nameDharunish
Enter member contact number9865573547
Enter member alternate contact number9876686355
Enter member eMail addressdharu00@[Link]
Enter member passGold
Enter member's trainer id3
Enter member date of join2022-08-19
Enter the member's attendance84 days
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=2
Enter the choice
[Link] Member details
[Link] Trainer details
[Link]
enter=1
(101, 'Akash', 9876549812, 6374916909, 'akaj123@[Link]', 'Silver',
[Link](2020, 9, 11), 1, '100 days')
(102, 'Gokul', 7864397612, 8924267987, 'gokul420@[Link]', 'Silver',
[Link](2021, 1, 24), 3, '107 days')
(103, 'Prajeet', 7689534722, 7689534821, 'praju891@[Link]', 'Gold',
[Link](2019, 7, 19), 1, '105 days')
(104, 'Sanjay', 9940050743, 9444256445, 'sanjay007@[Link]', 'Platinum',
[Link](2021, 8, 20), 3, '198 days')
(105, 'Dharunish', 9865573547, 9876686355, 'dharu00@[Link]', 'Gold',
[Link](2022, 8, 19), 3, '84 days')
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=3
Enter the choice
[Link] Member details
[Link] Trainer details
[Link]
enter=1
Enter the choice
[Link] Member alternate contact number
[Link] Member membership pass
[Link] Member eMail address
[Link]
enter=2
Enter new membership passPlatinum
Enter Member id103
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=4
Enter the choice
[Link] Member details
[Link] Trainer details
[Link]
enter=1
Enter Member id103
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=5
Enter the choice
[Link] Member report
[Link] Trainer report
[Link]
enter=1
Enter Member id104
('Sanjay', 9940050743, 'Platinum', 'Saileshwar', '198 days')
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=6
Enter the choice
[Link] Member details
[Link] Trainer details
[Link]
enter=1
Enter the choice
[Link] Member details by Member's id
[Link] Member details by Member's contact number
[Link]
enter=1
Enter Member id105
[(105, 'Dharunish', 9865573547, 9876686355, 'dharu00@[Link]', 'Gold',
[Link](2022, 8, 19), 3, '84 days')]
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=7
Enter the pass name to view the membership holder of selective plans
-Bronze
-Silver
-Gold
-Platinum
-Diamond
enter=Platinum
(104, 'Sanjay', 9940050743, 9444256445, 'sanjay007@[Link]', 'Platinum',
[Link](2021, 8, 20), 3, '198 days')
Enter the choice
[Link] DATA
[Link] DATA
[Link] DATA
[Link] DATA
[Link]
[Link]
[Link] HOLDER
[Link]
enter=8
Finished
BIBLIOGRAPHY
• Computer Science with Python –
Sumitha Arora
Preethi Arora

You might also like