0% found this document useful (0 votes)
16 views

Computer_Science_Project_-Aditya kumar.pdf

The document outlines a Computer Science project on a Football Club Management System developed by Aditya Kumar. It includes sections on acknowledgment, project introduction, development environment, backend overview, coding details, and database implementations using MySQL. Key features of the system include management of club performance, player transfers, and player statistics, aimed at simplifying football club operations.

Uploaded by

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

Computer_Science_Project_-Aditya kumar.pdf

The document outlines a Computer Science project on a Football Club Management System developed by Aditya Kumar. It includes sections on acknowledgment, project introduction, development environment, backend overview, coding details, and database implementations using MySQL. Key features of the system include management of club performance, player transfers, and player statistics, aimed at simplifying football club operations.

Uploaded by

kctb8hzf6q
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

COMPUTER SCIENCE PROJECT

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

5. Project Backend Overview Flowchart

6. Backend Explanation

7. Backend Implementations- Mysql Details

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’.

She has been a constant source of inspiration and


motivation for hard work .She has been very co-
operative throughout this project. Through this
column it would be my utmost pleasure to express my
warm thanks to her for encouragement and co-
operative without which I am not able to accomplish
this project.

Student: Aditya Kumar Signature: __________


Date:
Certificate Of Completion

This is to certify that Aditya Kumar of

Class 12th has completed this project of

FOOTBALL CLUB MANAGEMENT

SYSTEM under the guidance of MRS.

CHARU SOOD and this project may be

considered as a part of the practical exam

of AISSCE conducted by CBSE.

_________________
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.

The Football Club Management System recognizes that


successful football club management extends beyond the pitch
and into the realms of strategic planning, financial control, and
squad development. This project has been meticulously crafted
to provide the necessary structure and data organization that will
empower you to navigate the complexities of running a football
club effectively.

Key Features and Tables:

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.

Transfer Market Table: The transfer market is the lifeline of any


football club, and this table is your gateway to managing player
transfers efficiently. Track incoming and outgoing transfers, loan
deals, and player valuations. Stay on top of your club's financial
commitments and identify potential signings to strengthen your
squad.
Players Table: The heart of any football club lies within its
players, and this table provides comprehensive player
management. You can add, edit, or remove player profiles,
monitor their performance statistics, view contract details, and
even track player development. Whether you have a youth
academy or first-team players, this table helps you oversee the
talent within your club.
Fixtures and Results Table: Keep a detailed record of all your
club's fixtures, including dates, opponents, venues, and results.
This table ensures that you're always up to date with the
schedule, helping you avoid conflicts and manage match
preparation effectively.

Staff and Team Management Table: Manage your coaching staff,


medical teams, and other support personnel to ensure the
smooth operation of your club's daily activities. Also, keep an
eye on player development and training programs to nurture
talent.

The Football Club Management System is a highly adaptable


project, allowing you to customize it to meet your club's unique
requirements. With user-friendly interfaces and dynamic tables,
it simplifies your daily tasks, reduces administrative overhead,
and enables you to concentrate on elevating your football club's
success.
Development Environment

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 Database: football_managment_sys

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

Mysql command to Create Database:- create database football_managment_sys

Mysql command to Use Database:- use football_managment_sys

Mysql command to create table club:- CREATE TABLE Club (


club_id INT(50) PRIMARY KEY,
club_name VARCHAR(25),
Club_location VARCHAR(30),
Stadium_capacity INT(200),
head_coach VARCHAR(25));
Mysql command to describe table club:- desc club;

Mysql command to insert values into table club:- Insert into


club(club_id,club_name,club_location,stadium_capacity,head_coach)
values
(10021,'Manchester City F.C.','Manchester',70000,'Pep Guardiola'),
(10022,'Manchester United F.C.','Manchester',85000,'Sir Alex Furgesan'),
(10023,'Tottenham','London',76000,'Antonio Conte'),
(10024,'Liverpool F.C.','Liverpool',80000,'Jurgen Klopp'),
(10025,'Chelsea F.C.','London',95000,'Frank Lampard'),
(10026,'Arsenal','North London',83000,'Arsne Wenger'),
(10027,'Burnley','Lancashire',65000,'Vincent Kompany'),
(10028,'Everton F.C.','Liverpool City',71000,'Carlo Ancelotti'),
(10029,'Leicester City F.C.','Leicester',82000,'Enzo Maresca'),
(10030,'Newcastle United F.C.','Tyne',99000,'Eddie Howe');
Mysql command to View records:- select * from club;

Mysql command to create table league_table:- CREATE TABLE


League_Table (
Team_Name Varchar(50) Primary key,
Matches_Played INT(5),
Wins INT(50),
Draw INT(50),
Loss INT(50),
Goals_for INT(200),
Goals_against INT(200),
Goal_diffrence INT(200),
Points INT(200));
Mysql command to desc table league_table:- desc league_table;

Mysql command to insert values into table league_table: Insert into


League_Table(Team_Name,Matches_Played,Wins,Draw,Loss,Goals_for,Goals_Ag
ainst,Goal_Diffrence,Points)
values
('Manchester City',38,32,4,2,106,27,79,100),
('Manchester united',38,25,6,7,68,28,40,81),
('Tottenham',38,23,8,7,74,36,38,77),
('Liverpool',38,21,12,5,84,38,46,75),
('Chelsea',38,21,7,10,62,38,24,70),
('Arsenal',38,19,6,13,74,51,23,63),
('Burnley',38,14,12,12,36,39,-3,54),
('Everton',38,13,10,15,44,58,-14,49),
('Leicester City',38,12,11,15,56,60,-4,47),
('Newcastle',38,12,8,18,38,47,-8,44);
Mysql command to view records:- select * from league_table;

Mysql command to create table players:- CREATE TABLE Players (


player_id INT(50),
club_id INT(50),
Team_name Varchar(50),
primary key(club_id,team_name,player_id),
Player_name VARCHAR(50),
Position VARCHAR(50),
Nationality VARCHAR(50));

Mysql command to desc table players:- desc players;

Mysql command to insert values into players:- Insert into


Players(player_id,club_id,Team_name,Player_name,Position,Nationality)
values
(119281,10021,'Manchester City','Kevin De Bruyne','Centre Attacking
Midfielder','Belgium'),
(921829,10024,'Liverpool','Sadio Mane','Left Winger','Senegal'),
(394839,10029,'Leicester City','Jamie Vardy','Striker','England'),
(736488,10026,'Arsenal','Mesut Ozil','Central Midfielder','Germany'),
(837483,10030,'Newcastle','Nick Pope','Goalkeeper','England'),
(649387,10022,'Manchester United','Harry Maguire','Centre Back','England'),
(456478,10025,'Chelsea','Cesar Azpilicueta','Right Wing Back','Spain'),
(912839,10028,'Everton','Richarlison','Right Winger','Brazil'),
(764376,10023,'Tottenham','Christian Eriksen','Central Midfielder','Switzerland'),
(289378,10021,'Manchester City','Oleksandr Zinchenko','Left Back','Ukraine'),
(672372,10027,'Burnely','Kieran Trippier','Right Back','English'),
(873287,10022,'Manchester United','Casemiro','Central Defensive
Midfielder','Brazil');

Mysql command to view records of table players:- select * from players;

Mysql command to create table transfer_market:- CREATE TABLE


Transfer_Market(
player_id INT(50),
club_id INT(50),
primary key(club_id,player_id),
Player_name VARCHAR(50),
Age INT(10),
Speciality VARCHAR(200),
Transfer_Value INT(200));
Mysql command to desc table transfer_market: desc transfer_market;

Mysql command to insert values into table transfer_market: Insert into


Transfer_Market(player_id,club_id,player_name,Age,Speciality,Transfer_Value)
values
(119281,10021,'Kevin De Bruyne',26,'Can create chances out of
nothing',110000000),
(873287,10022,'Casemiro',31,'Physical Monster',55000000),
(456478,10025,'Cesar Azpilicueta',33,'Experienced,Plays for the badge',25000000),
(921829,10024,'Sadio Mane',25,'Explosive Pace , Skill Merchant',70000000),
(912839,10028,'Richarlison',23,'Promising young prospect',60000000),
(736488,10026,'Mesut Ozil',32,'Spatial awareness, Controls the centre',40000000),
(837483,10030,'Nick Pope',29,'6 foot 8, Nothing goes past him',35000000);
Mysql command to view records of transfer_market: select * from
transfer_market;
Project Coding

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:

h=int(input('''Welcome to Football Managment System


Which table would you like to access today
1)CLUB
2)Players
3)League table
4)transfer market
""TO EXIT ENTER 999""
Enter your choice: '''))
if h==1:
p.menuclub()
elif h==2:
q.menuplayers()
elif h==3:
r.menuleaguetable()
elif h==4:
s.menu_transfer_market()
elif h==999:
os._exit(0)

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

4) Delete details of player from the League table


5) Update values of the club table

6) Display all values in the Club table


7) Delete records from the players table
8) Display datails by player name in the transfer market table

9) Insert values into transfer market table


10) Delete record from transfer market table
BIBLIOGRAPHY

• Textbook For Computer Science Class 12 – NCERT

• Computer Science with Python- Preeti Arora

• Notes by Mrs Charu Sood

• https://stackoverflow.com

• https://www.youtube.com/watch?v=MhaH7o3lf4E

&pp=ygUeaG93IHRvIGNvbm5lY3QgbXlzcWwgd

G8gcHl0aG9u – How to connect Mysql to Python

You might also like