Professional Documents
Culture Documents
Project On Sports - Club PDF
Project On Sports - Club PDF
By:
KAMLESH KUMAR RAJAK (PGT CS) K V DAMOH (Jabapur Region)
SANJEEV SONI KV DHANA(Jabapur Region)
DBMS: MySQL
Host : localhost
User: root
Pass: ip
DataBase: sports
Table name -club
Table Structure: (Images Bellow)
Python Code:
import os
import platform
import mysql.connector
import pandas as pd
mydb=mysql.connector.connect(host="localhost",\
user="root",\
passwd="ip",\
database="sports")
mycursor=mydb.cursor()
def RegisterClub():
L=[]
enroll=int(input("Enter the registration number(Max 5 Digits) : "))
L.append(enroll)
def ClubView():
print("Select the search criteria : ")
print("1. Enroll")
print("2. Name")
print("3. Age")
print("4. City")
print("5. phone")
print("6. Address")
print("7. All")
ch=int(input("Enter the choice : "))
if ch==1:
s=int(input("Enter enroll no : "))
rl=(s,)
sql="select * from club where enroll=%s"
mycursor.execute(sql,rl)
elif ch==2:
s=input("Enter Name : ")
rl=(s,)
sql="select * from club where sname=%s"
mycursor.execute(sql,rl)
elif ch==3:
s=int(input("Enter age : "))
rl=(s,)
sql="select * from club where age=%s"
mycursor.execute(sql,rl)
elif ch==4:
s=input("Enter City : ")
rl=(s,)
sql="select * from club where City=%s"
mycursor.execute(sql,rl)
elif ch==5:
elif ch==6:
s=input("Enter address : ")
rl=(s,)
sql="select * from club where address=%s"
mycursor.execute(sql,rl)
elif ch==7:
sql="select * from club"
mycursor.execute(sql)
res=mycursor.fetchall()
print("The Memebers details are as follows : ")
print("(ROll, Name, Age, Class, City)")
for x in res:
print(x)
def SearchClub():
print("Please enter the details to view the fee details :")
enroll=int(input("Enter the enroll number of the member whose fee is to be viewed : "))
sql="Select * from club where enroll=%s"
rl=(enroll,)
mycursor.execute(sql,rl)
res=mycursor.fetchall()
if res==None:
print("Record not Found . . . ")
return
print("The details of the memebrs are : " )
for x in res:
print(x)
def RemoveClub():
enroll=int(input("Enter the enroll number of the memeber to be deleted : "))
rl=(enroll,)
sql="Delete from club where enroll=%s"
mycursor.execute(sql,rl)
mydb.commit()
userInput = int(input("Please Select An Above Option: ")) #Will Take Input From User except
ValueError:
# exit("\nHy! That's Not A Number") #Error Message
# finally:
print("\n") #Print New Line
if(userInput == 1):
RegisterClub()
elif (userInput==2):
ClubView()
elif (userInput==3):
SearchClub()
elif (userInput==4):
RemoveClub()
else:
print("Enter correct choice. . . ")
def runAgain():