Class12 Cs Project
Class12 Cs Project
1. Cer ficate 03
2. ACKNOWLEDGEMENT 04
3. INTRODUCTION 05
4. MYSQL DATABASE 06
8. Outputs 25-29
9. Bibliography 30
1|Page
DL DAV MODEL SCHOOL, SHALIMAR BAGH
PROJECT
FILE
SUBMITTED BY: DAKSH SINGH & RISHIT
AGGARWAL
CLASS: XII-A
ROLL NO: 06 & 21
SUBMITTED TO: Mrs. SEEMA BHATIA MAM
[PGT COMPUTER SCIENCE ]
2|Page
CERTIFICATE
This is to cer fy that Daksh Singh and Rishit
Aggarwal of class XII-A
(PCM) of DLDAV MODEL SCHOOL has done his
project on the Football club Management
system under my supervision. He has taken
interest and shown utmost sincerity in
comple ng this project.
3|Page
ACKNOWLEDGEMENT
It is with pleasure that I acknowledge my sincere
gra tude to our teacher, Ms. Seema Bha a who taught
and undertook the responsibility of teaching the subject
computer science. We have greatly benefited from her
classes.
My sincere thanks go to our Principal, Ms. Reena
Rajpal who has always been a source of encouragement
and support and without whose inspira on, this project
4|Page
INTRODUCTION
The Football Club Management System is a
simple and effec ve so ware tool designed to
help football clubs manage their players and
track their performance. This project is
especially useful for small to medium-sized
football clubs, providing an easy way to
handle important data like player details,
matches played, goals scored, and assists
made.
The system is built using Python for its
programming logic and MySQL for storing and
organizing data. It ensures that all informa on
is stored securely and can be easily accessed
or updated whenever needed. By combining
Python and MySQL, this project creates a
prac cal and user-friendly solu on for
football club management.
5|Page
CREATE DATABASE:
CREATE DATABASE football_club ;
USE football_club;
Crea ng playrs table:
The players table has three columns, which are
playerid, playername, playerposi on .
Create table players(
Playerid int() primary key ,
Playername varchar(30) not null ,
Playerposi on varchar(20) not null
);
Crea ng performance table:
The performance table has four columns, which are
playerid, matches, goals, assist .
Create table performance(
Playerid int() primary key ,
Matches int() ,
Goals int() ,
Assist int()
);
6|Page
Ge ng Started:
We need to make a connec on between the
MySQL database and Python so that the
tables can be accessed using python IDLE. For
making a connec on we need to install mysql-
connector which can be done by wri ng the
following command in the command prompt
on Windows. pip install mysql-connector-
python A er installa on of the mysql-
connector, we can connect MySQL with
Python which can be done by wri ng the
following code.
# Impor ng mysql connector module
import mysql.connector
# Making MySQLconnec on object
conn = mysql.connector.connect(
host='localhost', user='root',
password='password', database='football_club')
# Making MySQLcursor object cursor =
conn.cursor()
7|Page
Func ons used in the program:
8|Page
MainProgram:
The program first asks for a choice of the
manager to call the respec ve func ons for
the func oning of the program.
CompleteProjectCode:
import mysql.connector
9|Page
print(f"Error connec ng to the database:
{err}")
return None
try:
cursor = db.cursor()
10 | P a g e
playerid INT AUTO_INCREMENT
PRIMARY KEY,
playername VARCHAR(255) NOT
NULL,
playerposi on VARCHAR(255) NOT
NULL
)
""")
11 | P a g e
FOREIGN KEY (playerid) REFERENCES
players(playerid) ON DELETE CASCADE
)
""")
player_id = cursor.lastrowid
print(f"Player added with ID: {player_id}")
cursor.execute("INSERT INTO
performance (playerid) VALUES (%s)",
(player_id,))
db.commit()
if cursor.rowcount > 0:
print("Player details updated
successfully.")
else:
print("No player found with the given
ID.")
if cursor.rowcount > 0:
print("Performance updated
successfully.")
16 | P a g e
else:
print("No player found with the given
ID.")
17 | P a g e
cursor.execute("DELETE FROM players
WHERE playerid = %s", (playerid,))
db.commit()
if cursor.rowcount > 0:
print("Player deleted successfully.")
else:
print("No player found with the given
ID.")
print("\nPlayer Details:")
print("ID | Name | Posi on |
Matches | Goals | Assists")
19 | P a g e
print("-" * 60)
for player in players:
print(f"{player[0]:<3} | {player[1]:<10}
| {player[2]:<15} | {player[3]:<7} |
{player[4]:<5} | {player[5]:<6}")
if choice == '1':
playername = input("Enter player
name: ").strip()
playerposi on = input("Enter player
posi on: ").strip()
if playername and playerposi on:
add_player(playername,
playerposi on)
else:
print("Player name and posi on
cannot be empty.")
21 | P a g e
elif choice == '2':
try:
playerid = int(input("Enter player ID
to update details: "))
playername = input("Enter new
player name: ").strip()
playerposi on = input("Enter new
player posi on: ").strip()
if playername and playerposi on:
update_player_details(playerid,
playername, playerposi on)
else:
print("Player name and posi on
cannot be empty.")
except ValueError:
print("Invalid input. Please enter
numeric values for ID.")
elif choice == '3':
try:
22 | P a g e
playerid = int(input("Enter player ID
to update performance: "))
matches = int(input("Enter updated
matches played: "))
goals = int(input("Enter updated
goals scored: "))
assists = int(input("Enter updated
assists: "))
update_performance(playerid,
matches, goals, assists)
except ValueError:
print("Invalid input. Please enter
numeric values.")
elif choice == '4':
try:
playerid = int(input("Enter player ID
to delete: "))
delete_player(playerid)
except ValueError:
23 | P a g e
print("Invalid input. Please enter a
valid numeric ID.")
elif choice == '5':
view_players()
elif choice == '6':
print("Goodbye!")
break
else:
print("Invalid choice. Try again.")
24 | P a g e
OUTPUTS:
CHOICE1:
25 | P a g e
CHOICE2:
26 | P a g e
CHOICE3:
27 | P a g e
CHOICE4:
28 | P a g e
CHOICE5:
29 | P a g e
BIBLIOGRAPHY
1. www.w3schols.org\python3 (syntax)
30 | P a g e