Computer_Science_Project_-Aditya kumar.pdf
Computer_Science_Project_-Aditya kumar.pdf
ON
FOOTBALL CLUB MANAGMENT SYSTEM
Submitted by:-
Name: Aditya Kumar
Class & Sec: 12th B
Board Roll no:
School: St. Xavier’s Sr. Sec. , 4 , Raj Niwas Marg, Delh-
110054
INDEX
S.NO. TOPIC SIGN
1. Acknowledgment
2. Certificate of Completion
3. Introduction
4. Development Environment
6. Backend Explanation
8. Project Coding
9. Project Outputs
10. Bibliography
ACKNOWLEDGEMENT
I am extremely grateful and remain indebted to our
guide Mrs. Charu Sood for being a source of
inspiration and for her constant support in the
design implementation and evaluation of the
project. I am Thankful to her for the constant
invaluable suggestions which benefited me a lot
while developing the project on ‘FOOTBALL
CLUB MANAGEMENT SYSTEM’.
_________________
MRS. CHARU SOOD
St. Xavier’s School
INTRODUCTION
Welcome to the Football Club Management System, a robust
and user-friendly Python project designed to revolutionize the
way football clubs manage their operations. This comprehensive
software solution introduces powerful tools and features,
including dynamic tables, to help you effortlessly oversee
various aspects of your football club's administration, such as
club performance, league standings, transfer market activities,
and player management.
Club League Table: This table allows you to track your club's
performance in the league over the course of a season. It
displays vital statistics such as matches played, wins, draws,
losses, goals scored, and goals conceded. With real-time updates,
you can monitor your club's progress and assess its position in
the league standings.
Software Used: -
1. Python 3.12
2. Mysql Server 5.5
3. Windows 10(64-bit Operating System)
4. Microsoft Word Professional Plus 2019
5. Snipping Tool for screenshots
Online Help: -
1. Google for Images
Book Reference:-
1. Computer Science Notes by Mrs.Charu Sood
2. Computer Science Book by Preeti Arora
Hardware Used:-
1. 8 GB RAM
2. Intel Core i5 gen 9
3. 480 GB SSD
Project Backend Overview
Flowchart
league_table players
football_managment_sys
CLUB2 transfer_market
Backend Explanation
Name of Tables:-
1) club
2) league_table
3) players
4) transfer_market
Explanation
Club:-
It contains the details of all the clubs present in the Premier League.
Consists of 5 columns:-
club_id – Every Club has a unique club Id. Hence this is the primary key
club_name – Has the full name of the club
Club_location – City in which the club is located
Stadium_capacity - The maximum capacity of the club in terms of no of
people it can accommodate at any given time
Head_coach - Name of the Head Coach/Manager of the club.
League_table:-
Standings of all the teams present in the league. Contains 9 coloumns:-
Team_name: Name of the team Matches_played: Total no of matches
played by that team Wins: No of wins of the team in the league
Draw: No of drew games of the team in the league Loss: No of losses of
the team in the league Goals_for: No of goals scored by the team
Goals_against: No of goals conceded by the team Goal_difference:
Goals_for – Goals_against Points: Total points earned by the team
Players
Details of some of the major players playing in the league. Contains 6
coloumns:
Player_id: Every player has a unique player id hence it’s the primary key
Club_id: Id of the club they are a part of
Team_name: Name of the team the player plays for
Player_name: Full Name of the Player
Position: Main position of the player
Nationality: Country of the player
Transfer_market
Transfer details of players in demand. Has 6 coloumns:
Player_id: Every player has a unique player id hence it’s the primary key
Club_id: Id of the club the player is a part of
Player_name: Full Name of the player
Age: Age of the player rounded off
Speciality: Some attractive skills of the player
Transfer_Value: Current Price of the player in $
BackEnd Implementations – Mysql Details
Python files
1) main.py
2) CLUB2.py
3) league_table.py
4) players.py
5) transfer_market.py
File Coding
main.py
import CLUB2 as p import
players as q import
league_table as r import
transfer_market as s import
os while True:
Club2.py
import os
import mysql.connector as m
con=m.connect(user='root',passwd='yes',host='localhost',database='football_managment_s
ys')
cur=con.cursor()
def insert():
a=int(input("Enter club id(greater than 10030):"))
b=input("Enter club name:")
c=input("Enter the location of the club:")
d=input("Enter stadium capacity:")
e=input("Enter head coach name:")
q="insert into club values(%s,%s,%s,%s,%s)"
t=(a,b,c,d,e)
cur.execute(q,t)
con.commit()
print("record entered successfully!!")
def delete():
club_id=int(input("Enter club id whose record you want to be wiped of:"))
q='delete from club where club_id=%s'
t=(club_id,)
cur.execute(q,t)
con.commit()
def update():
club_id=int(input("Enter club id whose record you want to make changes to:"))
clubname=input("Enter new club name:")
clubloc=input("Enter club location:")
stadcap=int(input("Enter stadium capacity:"))
headcoach=input("Enter name of head coach:")
q='update club set
club_name=%s,club_location=%s,stadium_capacity=%s,head_coach=%s where club_id=%s'
t=(clubname,clubloc,stadcap,headcoach,club_id)
cur.execute(q,t)
con.commit()
def selectall():
q="select * from club"
cur.execute(q)
for (id,clubname,clubloc,stadcap,headcoach) in cur:
print("---------------------------------------------------------------------")
print("Club id : ",id)
print("Club name : ",clubname)
print("Club location: ",clubloc)
print("Stadium Capacity : ",stadcap)
print("HeadCoach : ",headcoach)
print("---------------------------------------------------------------------")
def selectspecefic():
print(" To display by club_id press 1 \n To display by name press 2 \n To display by club
location")
choice=int(input("enter choice:"))
if choice==1:
a=int(input('enter club id you want to get the details of(strating from 10021:'))
q="select * from club where club_id=%s"
t=(a,)
cur.execute(q,t)
for (id,clubname,clubloc,stadcap,headcoach) in cur:
print("---------------------------------------------------------------------")
print("Club id : ",id)
print("Club name : ",clubname)
print("Club location: ",clubloc)
print("Stadium Capacity : ",stadcap)
print("HeadCoach : ",headcoach)
print("---------------------------------------------------------------------")
elif choice==2:
name=input("enter club name u want to display the details of:")
q="select * from club where club_name=%s"
t=(name,)
cur.execute(q,t)
for (id,clubname,clubloc,stadcap,headcoach) in cur:
print("---------------------------------------------------------------------")
print("Club id : ",id)
print("Club name : ",clubname)
print("Club location: ",clubloc)
print("Stadium Capacity : ",stadcap)
print("HeadCoach : ",headcoach)
print("---------------------------------------------------------------------")
elif choice==3:
loc=input("enter club location:")
q="select * from club where club_location=%s"
t=(loc,)
cur.execute(q,t)
for (id,clubname,clubloc,stadcap,headcoach) in cur:
print("---------------------------------------------------------------------")
print("Club id : ",id)
print("Club name : ",clubname)
print("Club location : ",clubloc)
print("Stadium Capacity : ",stadcap)
print("HeadCoach : ",headcoach)
print("---------------------------------------------------------------------")
def menuclub():
print("-----------------------------------------------------------------------------")
print("If you want to insert values into the club table ENTER '1'")
print("If you want to delete values into the club table ENTER '2'")
print("If you want to update values into the club table ENTER '3'")
print("If you want to display all values of the club table ENTER '4'")
print("If you want to display specefic values of the club table ENTER '5'")
print("-----------------------------------------------------------------------------")
ch=int(input("Enter your Choice:"))
if ch==1:
insert()
elif ch==2:
delete()
elif ch==3:
update()
elif ch==4:
selectall()
elif ch==5:
selectspecefic()
else:
os._exit(0)
League_table.py
import os
import mysql.connector as m
con=m.connect(user='root',passwd='yes',host='localhost',database='football_managment_s
ys')
cur=con.cursor()
def insert():
a=input("Enter Team Nmae:")
b=int(input("Enter Matches Played:"))
c=int(input("Enter Wins:"))
d=int(input("Enter Draw:"))
e=int(input("Enter Loss:"))
f=int(input("Enter Goals for:"))
g=int(input("Enter Goals against:"))
h=int(input("Enter Goals difference:"))
i=int(input("Enter Goals Points:"))
q="insert into league_table values(%s,%s,%s,%s,%s,%s,%s,%s,%s)"
t=(a,b,c,d,e,f,g,h,i)
cur.execute(q,t)
con.commit()
print("record entered successfully!!")
def delete():
T_name=input("enter team name whose record you want to be wiped of:")
q='delete from league_table where team_name=%s'
t=(T_name,)
cur.execute(q,t)
con.commit()
def update():
Team_name=input("enter the team name of the club who you want to change the details
of:")
a=input("Enter Team Nmae:")
b=int(input("Enter Matches Played:"))
c=int(input("Enter Wins:"))
d=int(input("Enter Draw:"))
e=int(input("Enter Loss:"))
f=int(input("Enter Goals for:"))
g=int(input("Enter Goals against:"))
h=int(input("Enter Goals difference:"))
i=int(input("Enter Goals Points:"))
q='UPDATE league_table SET
team_name=%s,matches_played=%s,wins=%s,draw=%s,loss=%s,Goals_for=%s,goals_against
=%s,goal_difference=%s,points=%s WHERE team_name=%s'
t=(a,b,c,d,e,f,g,h,i,Team_name)
cur.execute(q,t)
con.commit()
def selectall():
q="select * from league_table"
cur.execute(q)
for (a,b,c,d,e,f,g,h,i) in cur.fetchall():
print("---------------------------------------------------------------------")
print("Team name : ",a)
print("Matches played : ",b)
print("Wins : ",c)
print("Draw : ",d)
print("Loss : ",e)
print("GOals for : ",f)
print("GOals against : ",g)
print("GOals difference : ",h)
print("GOals points : ",i)
print("---------------------------------------------------------------------")
def selectspecefic():
print(" To display by Team name press 1 \n To display by matches played press 2 \n To
display by club Points press 3")
choice=int(input("enter choice:"))
if choice==1:
a=int(input('enter player id you want to get the details of:'))
q="select * from league_table where team_name=%s"
t=(a,)
cur.execute(q,t)
for (k,b,c,d,e,f,g,h,i) in cur:
print("---------------------------------------------------------------------")
print("Team name : ",k)
print("Matches played : ",b)
print("Wins : ",c)
print("Draw : ",d)
print("Loss : ",e)
print("GOals for : ",f)
print("GOals against : ",g)
print("GOals difference : ",h)
print("GOals points : ",i)
print("---------------------------------------------------------------------")
elif choice==2:
name=input("enter club id you want to display the details of:")
q="select * from league_table where matches_played=%s"
t=(name,)
cur.execute(q,t)
for (a,b,c,d,e,f,g,h,i) in cur:
print("---------------------------------------------------------------------")
print("Team name : ",a)
print("Matches played : ",b)
print("Wins : ",c)
print("Draw : ",d)
print("Loss : ",e)
print("GOals for : ",f)
print("GOals against : ",g)
print("Goals difference : ",h)
print("Goals points : ",i)
print("---------------------------------------------------------------------")
elif choice==3:
loc=input("enter points")
q="select * from league_table where points<=%s"
t=(loc,)
cur.execute(q,t)
for (a,b,c,d,e,f,g,h,i) in cur:
print("---------------------------------------------------------------------")
print("Team name : ",a)
print("Matches played : ",b)
print("Wins : ",c)
print("Draw : ",d)
print("Loss : ",e)
print("GOals for : ",f)
print("GOals against : ",g)
print("GOals difference : ",h)
print("GOals points : ",i)
print("---------------------------------------------------------------------")
def menuleaguetable():
print("-----------------------------------------------------------------------------")
print("If you want to insert values into the league table ENTER '1'")
print("If you want to delete values into the league table ENTER '2'")
print("If you want to update values into the league table ENTER '3'")
print("If you want to display all values of the league table ENTER '4'")
print("If you want to display specefic values of the league table ENTER '5'")
print("-----------------------------------------------------------------------------")
ch=int(input("Enter your Choice:")) if ch==1:
insert()
elif ch==2:
delete()
elif ch==3:
update()
elif ch==4:
selectall()
elif ch==5:
selectspecefic()
else:
os._exit(0)
Players.py
import os
import mysql.connector as m
con=m.connect(user='root',passwd='yes',host='localhost',database='football_managment_s
ys')
cur=con.cursor()
def insert():
a=int(input("Enter Player id:"))
b=input("Enter Club id:")
c=input("Enter Team name:")
d=input("Enter Player Name:")
e=input("Enter Position:")
f=input("Enter Nationality:")
q="insert into players values(%s,%s,%s,%s,%s,%s)"
t=(a,b,c,d,e,f)
cur.execute(q,t)
con.commit()
print("record entered successfully!!")
def delete():
P_id=int(input("enter player id whose record you want to be wiped of:"))
q='delete from players where player_id=%s'
t=(P_id,)
cur.execute(q,t)
con.commit()
def update():
Player_id=input("enter the Player id of the player who you want to change the details of:")
Pid=int(input("Enter Player id:"))
Cid=input("Enter Club id:")
Tname=input("Enter Team name:")
Pname=input("Enter Player Name:")
POs=input("Enter Position:")
Nat=input("Enter Nationality:")
q='update players set
Player_id=%s,Club_id=%s,Team_name=%s,Player_name=%s,Position=%s,Nationality=%s
where player_id=%s'
t=(Pid,Cid,Tname,Pname,POs,Nat,Player_id)
cur.execute(q,t)
con.commit()
def selectall():
q="select * from players"
cur.execute(q)
for (Pid,Cid,Tname,Pname,POs,Nat) in cur.fetchall():
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Tname)
print("Player Name : ",Pname)
print("Position : ",POs)
print("Nationality : ",Nat)
print("---------------------------------------------------------------------")
def selectspecefic():
print(" To display by player_id press 1 \n To display by club id press 2 \n To display by club
location")
choice=int(input("enter choice:"))
if choice==1:
a=int(input('enter player id you want to get the details of:'))
q="select * from players where player_id=%s"
t=(a,)
cur.execute(q,t)
for (Pid,Cid,Tname,Pname,POs,Nat) in cur:
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Tname)
print("Player Name : ",Pname)
print("Position : ",POs)
print("Nationality : ",Nat)
print("---------------------------------------------------------------------")
elif choice==2:
name=input("enter club id you want to display the details of:")
q="select * from players where club_id=%s"
t=(name,)
cur.execute(q,t)
for (Pid,Cid,Tname,Pname,POs,Nat) in cur:
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Tname)
print("Player Name : ",Pname)
print("Position : ",POs)
print("Nationality : ",Nat)
print("---------------------------------------------------------------------")
elif choice==3:
loc=input("enter players nationality:")
q="select * from players where Nationality=%s"
t=(loc,)
cur.execute(q,t)
for (Pid,Cid,Tname,Pname,POs,Nat) in cur:
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Tname)
print("Player Name : ",Pname)
print("Position : ",POs)
print("Nationality : ",Nat)
print("---------------------------------------------------------------------")
def menuplayers():
print("-----------------------------------------------------------------------------")
print("If you want to insert values into the players table ENTER '1'")
print("If you want to delete values into the players table ENTER '2'")
print("If you want to update values into the players table ENTER '3'")
print("If you want to display all values of the players table ENTER '4'")
print("If you want to display specefic values of the playersable ENTER '5'")
print("-----------------------------------------------------------------------------")
ch=int(input("Enter your Choice:"))
if ch==1:
insert()
elif ch==2:
delete()
elif ch==3:
update()
elif ch==4:
selectall()
elif ch==5:
selectspecefic()
else:
os._exit(0)
Transfer_market.py
import os
import mysql.connector as m
con=m.connect(user='root',passwd='yes',host='localhost',database='football_managment_s
ys')
cur=con.cursor()
def insert():
a=int(input("Enter Player id:"))
b=input("Enter Club id:")
c=input("Enter Player name:")
d=input("Enter age:")
e=input("Enter speciallity:")
f=input("Enter transfer value:")
q="insert into transfer_market values(%s,%s,%s,%s,%s,%s)"
t=(a,b,c,d,e,f)
cur.execute(q,t)
con.commit()
print("record entered successfully!!")
def delete():
P_id=int(input("enter player id whose record you want to be wiped of:"))
q='delete from transfer_market where player_id=%s'
t=(P_id,)
cur.execute(q,t)
con.commit()
def update():
Player_id=input("enter the Player id of the player who you want to change the details of:")
Pid=int(input("Enter Player id:"))
Cid=input("Enter Club id:")
age=int(input("Enter age:"))
Pname=input("Enter Player Name:")
special=input("Enter speciallity:")
Tval=input("Enter transfer_value:")
q='update transfer_market set
Player_id=%s,Club_id=%s,Player_name=%s,age=%s,speciality=%s,transfer_value=%s where
player_id=%s'
t=(Pid,Cid,Pname,age,special,Tval,Player_id)
cur.execute(q,t)
con.commit()
def selectall():
q="select * from transfer_market"
cur.execute(q)
for (Pid,Cid,Pname,age,speciality,transfer_value) in cur.fetchall():
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Pname)
print("Player Name : ",age)
print("Position : ",speciality)
print("Nationality : ",transfer_value)
print("---------------------------------------------------------------------")
def selectspecefic():
print(" To display by player_id press 1 \n To display by club id press 2 \n To display by club
location")
choice=int(input("enter choice:"))
if choice==1:
a=int(input('enter player id you want to get the details of:'))
q="select * from transfer_market where player_id=%s"
t=(a,)
cur.execute(q,t)
for (Pid,Cid,Pname,age,speciality,transfer_value) in cur.fetchall():
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Pname)
print("Player Name : ",age)
print("Position : ",speciality)
print("Nationality : ",transfer_value)
print("---------------------------------------------------------------------")
elif choice==2:
name=input("enter club id you want to display the details of:")
q="select * from transfer_market where club_id=%s"
t=(name,)
cur.execute(q,t)
for (Pid,Cid,Pname,age,speciality,transfer_value) in cur.fetchall():
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Pname)
print("Player Name : ",age)
print("Position : ",speciality)
print("Nationality : ",transfer_value)
print("---------------------------------------------------------------------")
elif choice==3:
loc=input("enter players name:")
q="select * from transfer_market where player_name=%s"
t=(loc,)
cur.execute(q,t)
for (Pid,Cid,Pname,age,speciality,transfer_value) in cur.fetchall():
print("---------------------------------------------------------------------")
print("player id : ",Pid)
print("Club id : ",Cid)
print("Team Name : ",Pname)
print("Player Name : ",age)
print("Position : ",speciality)
print("Nationality : ",transfer_value)
print("---------------------------------------------------------------------")
def menu_transfer_market():
print("-----------------------------------------------------------------------------")
print("If you want to insert values into the trasnfer_market table ENTER '1'")
print("If you want to delete values into the trasnfer_market table ENTER '2'")
print("If you want to update values into the trasnfer_market table ENTER '3'")
print("If you want to display all values of the trasnfer_market table ENTER '4'")
print("If you want to display specefic values of the trasnfer_market table ENTER '5'")
print("-----------------------------------------------------------------------------")
ch=int(input("Enter your Choice:"))
if ch==1:
insert()
elif ch==2:
delete()
elif ch==3:
update()
elif ch==4:
selectall()
elif ch==5:
selectspecefic()
else:
os._exit(0)
Outputs
1)Insert details in the players table
2) Display all details in the League table
3) Display player details by inputting club id in the transfer
market table
• https://stackoverflow.com
• https://www.youtube.com/watch?v=MhaH7o3lf4E
&pp=ygUeaG93IHRvIGNvbm5lY3QgbXlzcWwgd