Professional Documents
Culture Documents
Project On Scholar Registration PDF
Project On Scholar Registration PDF
By:
DBMS : MYSQL
HOST NAME : LOCAL HOST
USER : root
PASSWORD : root
DATABASE NAME : scholar
TABLES CREATED : scholar
import os
import platform
import mysql.connector
import pandas as pd
mydb=mysql.connector.connect(host="localhost",\
user="root",\
passwd="root",\
database="scholar")
mycursor=mydb.cursor()
def RegisterScholar():
L=[]
L.append(enroll)
L.append(name)
L.append(age)
L.append(city)
L.append(classs)
L.append(ph)
L.append(add)
L.append(regfee)
schol=(L)
mycursor.execute(sql,schol)
mydb.commit()
def ScholarView():
print("1. Enroll")
print("2. Name")
print("3. Age")
print("4. City")
print("5. phone")
print("6. Address")
print("7. All")
if ch==1:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==2:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==3:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==4:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==5:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==6:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==7:
mycursor.execute(sql)
res=mycursor.fetchall()
for x in res:
print(x)
def SearchScholar():
enroll=int(input("Enter the enroll number of the student whose fee is to be viewed : "))
rl=(enroll,)
mycursor.execute(sql,rl)
res=mycursor.fetchall()
if res==None:
return
for x in res:
print(x)
def RemoveScholar():
mycursor.execute(sql,rl)
mydb.commit()
userInput = int(input("Please Select An Above Option: ")) #Will Take Input From User
except ValueError:
else:
if(userInput == 1):
RegisterScholar()
elif (userInput==2):
ScholarView()
elif (userInput==3):
SearchScholar()
elif (userInput==4):
RemoveScholar()
else:
MenuSet()
def runAgain():
runAgn = input("\nwant To Run Again Y/n: ")
while(runAgn.lower() == 'y'):
if(platform.system() == "Windows"):
print(os.system('cls'))
else:
print(os.system('clear'))
MenuSet()
runAgain()
Register scholar
View scholar
Search scholar
Remove scholar