KENDRIYA VIDYALAYA
AMC ,LKO
2019-20
COMPUTER SCIENCE
( PYTHON NEW )
A PROJECT REPORT ON
SCHOOL MANAGEMENT
(CLASS :12TH)
SUBMITTED BY : GUIDED BY:
Aditya Kumar [Link] Awasthi
ROLLNO: 23676269 PGT [Link]
Table of contents
Acknowledgement
Certificate
Requirements
Python Coding with Mysql
Connectivity
Output
Bibliography
Acknowledgement
I would like to express my sincere
gratitude to my computer teacher
[Link] Awasthi for her vital support ,
guidance and encouragement and
without this project would not have
comeforth . I would like to express my
gratitude to the staff of the
Department of Computer Science at
Kendriya Vidyalaya AMC ,Lko for their
support during the making of this
project.
ANUSHKA SINGH
Class12thA
Certificate
This is to certified that Anushka Singh
of class 12th has successfully
completed her research on the
project entitled ‘School Management’
under the guidance of [Link]
Awasthi during the year 2019-2020 .
For the fulfilment of AISSCE Practical
Examination conducted by CBSE
Board.
ProjectCoordinator
(DepartmentofComputerScience)
Requirements
HARDWARE REQUIRED
Printer (to print the required documents of the project )
Compact Discand Drive
Processor : Intel Pentium Quadcore
Ram : 2GB
HardDisk : 120GB
SOFTWARE REQUIRED
Operating system : Windows–7/10 , MacOs ,Linux / Ubantu
Python IDE( for execution)
Mysql
MS Word (for presentation of output)
Python coding with
MySQL connectivity
PROJECT TITLE - “ SCHOOL MANAGEMENT ”
DBMS: My SQL
Host : local host
User: root
Password: tiger
DataBase : mysql
Table Structure: As per the Screenshot given below:
Table:Student
Table:Emp
Table:Fee
Table:Exam
Python Code:
import os
import platform
import [Link]
#import pandas as pd
#from pandas import Data Frame
def selection():
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
print ('-----------------------------------\nWELCOME TO SCHOOL
MANAGEMENT SYSTEM\n-----------------------------------')
print ("[Link] MANAGEMENT")
print ("[Link] MANAGEMENT")
print ("[Link] MANAGEMENT")
print ("[Link] MANAGEMENT")
ch= int(input(" \nEnter ur choice (1-4) : "))
if ch == 1:
print ('\nWELCOME TO STUDENT MANAGEMENT SYSTEM\n')
print ('[Link] ADMISSION')
print ('[Link] STUDENT DETAILS')
print ('[Link] TC')
c= input("Enter ur choice (a-c) : ")
print ('\nInitially the details are..\n')
display1 ()
if c=='a':
insert1()
print ('\nModified details are..\n')
display1()
elif c=='b':
update1()
print ('\nModified details are..\n')
display1()
elif c=='c':
delete1()
print ('\nModified details are..\n')
display1()
else:
print ('Enter correct choice...!!')
elif ch==2:
print ('WELCOME TO EMPLOYEE MANAGEMENT SYSTEM')
print ('[Link] EMPLOYEE')
print ('[Link] STAFF DETAILS')
print ('[Link] EMPLOYEE')
c=input("Enter ur choice : ")
if c=='a':
insert2()
print ('\nModified details are..\n')
display2()
elif c=='b':
update2()
print ('\nModified details are..\n')
display2()
elif c=='c':
delete2()
print ('\nModified details are..\n')
display2()
else:
print ('Enter correct choice...!!')
elif ch==3:
print ('WELCOME TO FEE MANAGEMENT SYSTEM')
print ('[Link] FEE')
print ('[Link] FEE')
print ('[Link] FEE')
c=input("Enter ur choice : ")
if c=='a':
insert3()
elif c=='b':
update3()
elif c=='c':
delete3()
else:
print ('Enter correct choice...!!')
elif ch==4:
print ('WELCOME TO EXAM MANAGEMENT SYSTEM')
print ('[Link] DETAILS')
print ('[Link] DETAILS ')
print ('[Link] DETAILS')
c=input("Enter ur choice : ")
if c=='a':
insert4()
elif c=='b':
update4()
elif c=='c':
delete4()
else:
print ('Enter correct choice...!!')
else:
print ('Enter correct choice..!!')
def insert1():
sname = input("Enter Student Name : ")
admno = int(input("Enter Admission No : "))
dob = input("Enter Date of Birth(yyyy-mm-dd): ")
cls = input("Enter class for admission: ")
cty = input("Enter City : ")
db = [Link](user='root', password='tiger',
host ='localhost',database='mysql')
cursor = [Link]()
sql = "INSERT INTO student(sname,admno,dob,cls,cty)
VALUES ( '%s' ,'%d','%s','%s','%s')"%
(sname,admno,dob,cls,cty)
try:
[Link](sql)
[Link]()
except:
[Link]()
[Link]()
#insert()
def display1():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM student"
[Link](sql)
results = [Link]()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
print ("(sname=%s,admno=%d,dob=%s,cls=%s,cty=%s)" %
(sname,admno,dob,cls,cty))
except:
print ("Error: unable to fetch data")
[Link]()
def update1():
try:
db = [Link](user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM student"
[Link](sql)
results = [Link]()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
print ()
tempst = int(input("Enter Admission No : "))
temp = input("Enter new class : ")
try:
sql = "Update student set cls=%s where admno='%d'" %
(temp,tempst)
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
def delete1():
try:
db = [Link](user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM student"
[Link](sql)
results = [Link]()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
temp = int(input("\nEnter adm no to be deleted : "))
try:
sql = "delete from student where admno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) :
")
if ans=='y' or ans=='Y':
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
def insert2():
ename = input("Enter Employee Name : ")
empno = int(input("Enter Employee No : "))
job = input("Enter Designation: ")
hiredate = input("Enter date of joining: ")
db = [Link](user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = [Link]()
sql = "INSERT INTO emp(ename,empno,job,hiredate) VALUES
( '%s' ,'%d','%s','%s')"%(ename,empno,job,hiredate)
try:
[Link](sql)
[Link]()
except:
[Link]()
[Link]()
def display2():
try:
db = [Link](user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM emp"
[Link](sql)
results = [Link]()
for c in results:
ename = c[0]
empno= c[1]
job=c[2]
hiredate=c[3]
print ("(empno=%d,ename=%s,job=%s,hiredate=%s)" %
(empno,ename,job,hiredate))
except:
print ("Error: unable to fetch data")
[Link]()
def update2():
try:
db = [Link](user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM emp"
[Link](sql)
results = [Link]()
for c in results:
ename = c[0]
empno= c[1]
job=c[2]
hiredate=c[3]
except:
print ("Error: unable to fetch data")
print()
tempst=int(input("Enter Employee No : "))
temp=input("Enter new designation : ")
try:
sql = "Update emp set job=%s where empno='%d'" %
(temp,tempst)
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
def delete2():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROMemp"
[Link](sql)
results = [Link]()
for c in results:
ename = c[0]
empno= c[1]
job=c[2]
hiredate=c[3]
except:
print ("Error: unable to fetch data")
temp=int(input("\nEnter emp no to be deleted : "))
try:
sql = "delete from emp where empno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) :
")
if ans=='y' or ans=='Y':
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
def insert3():
admno = int(input("Enter adm no: "))
fee = float(input("Enter fee amount : "))
month = input("Enter Month: ")
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "INSERT INTO fee(admno,fee,month) VALUES
( '%d','%d','%s')"%(admno,fee,month)
try:
[Link](sql)
[Link]()
except:
[Link]()
[Link]()
def display3():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM fee"
[Link](sql)
results = [Link]()
for c in results:
admno= c[0]
fee=c[1]
month=c[2]
print ("(admno=%d,fee=%s,month=%s)" %
(admno,fee,month))
except:
print ("Error: unable to fetch data")
[Link]()
def update3():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM fee"
[Link](sql)
results = [Link]()
for c in results:
admno= c[0]
fee=c[1]
month=c[2]
except:
print ("Error: unable to fetch data")
print()
tempst=int(input("Enter Admission No : "))
temp=input("Enter new class : ")
try:
sql = "Update fee set month=%s where admno='%d'" %
(temp,tempst)
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
def delete3():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM fee"
[Link](sql)
results = [Link]()
for c in results:
admno= c[0]
fee=c[1]
month=c[2]
except:
print ("Error: unable to fetch data")
temp=int(input("\nEnter adm no to be deleted : "))
try:
sql = "delete from student where admno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) :
")
if ans=='y' or ans=='Y':
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
def insert4():
sname=input("Enter Student Name : ")
admno=int(input("Enter Admission No : "))
per=float(input("Enter percentage : "))
res=input("Enter result: ")
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql="INSERT INTO exam(sname,admno,per,res) VALUES
( '%s' ,'%d','%s','%s')"%(sname,admno,per,res)
try:
[Link](sql)
[Link]()
except:
[Link]()
[Link]()
def display4():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM exam"
[Link](sql)
results = [Link]()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
print ("(sname,admno,per,res)"%(sname,admno,per,res) )
except:
print ("Error: unable to fetch data")
[Link]()
def update4():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM exam"
[Link](sql)
results = [Link]()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
print()
tempst=int(input("Enter Admission No : "))
temp=input("Enter new result : ")
try:
sql = "Update student set res=%s where admno='%d'" %
(temp,tempst)
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
def delete4():
try:
db = [Link](user='root', password='tiger',
host='localhost',database='mysql')
cursor = [Link]()
sql = "SELECT * FROM exam"
[Link](sql)
results = [Link]()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
temp=int(input("\nEnter adm no to be deleted : "))
try:
sql = "delete from exam where admno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) :
")
if ans=='y' or ans=='Y':
[Link](sql)
[Link]()
except Exception as e:
print (e)
[Link]()
selection()
OUTPUT:
INSERT DETAILS
UPDATE DETAILS
DELETE DETAILS
Bibliography
Text book by Sumita Arora
Wikipedia
GoogleSearch
[Link]