School Management System Documentation
School Management System Documentation
COMPUTER SCIENCE
PROJECT
1
SCHOOL MANAGEMENT SYSTEM
Table of content
Acknowledgement
Certificate
Introduction
Objective
Database
Source Code
Program Output
Bibliography
2
SCHOOL MANAGEMENT SYSTEM
Introduction
This application has a keen eye on each information of school. It keeps all
records within the database. This System is not only profitable to teacher but also
to the student for maintaining their record. Teacher can easily get the details of
product. There is no problem regarding with this software and can easily be
handle by the teacher.
3
SCHOOL MANAGEMENT SYSTEM
Objective
4
SCHOOL MANAGEMENT SYSTEM
Software Python
Notepad
MS WORD
MYSQL
5
SCHOOL MANAGEMENT SYSTEM
Database
6
SCHOOL MANAGEMENT SYSTEM
Source Code
import school_management as sm
sm.cls()
print("\t\t\t\t\tWELCOME TO CLASS ROOM MANAGEMENT SYSTEM")
ch=input("\tIf you are working first time in the system then press Y or y other wise press N or n :")
if ch in ('Y','y'):
sm.database()
sm.table()
while True:
print("\t\t\t\t\tWELCOME TO CLASS ROOM MANAGEMENT SYSTEM")
print("\t\t\t\t\tEnter 1 to Insert detail of a student")
print("\t\t\t\t\tEnter 2 to Update record of a student")
print("\t\t\t\t\tEnter 3 to Delete record of student")
print("\t\t\t\t\tEnter 4 to Generate Report Card")
print("\t\t\t\t\tEnter 5 to Show details of all students")
print("\t\t\t\t\tEnter 6 to Insert Marks in Examination")
print("\t\t\t\t\tEnter 7 to exit")
ch=input("\t\t\t\t\tEnter your choice :\t")
if ch=='1':
sm.cls()
sm.insert()
elif ch=='2':
sm.cls()
sm.update()
elif ch=='3':
sm.cls()
sm.delete()
elif ch=='4':
sm.cls()
sm.reportcard()
print("\n\n\n")
elif ch=='5':
sm.cls()
sm.showall()
print("\n\n\n")
elif ch=='6':
sm.cls()
sm.marks()
elif ch=='7':
sm.cls()
print("\t\t\t\t\tTHANK YOU FOR USING CLASS ROOM MANAGEMENT SYSTEM")
break
7
SCHOOL MANAGEMENT SYSTEM
else:
print("\t\t\t\t\tYOU HAVE CHOOSE WRONG OPTION PLEASE CHOOSE CORRECT ONE")
import mysql.connector
def cls():
print("\n"*40)
def database():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="")
ss=mydb.cursor()
db="create database school_management"
ss.execute(db)
mydb.close()
ss.close()
print("\n\n\n")
def table():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database=’school_manageme
nt')
ss=mydb.cursor()
ss.execute("create table student(rno int(5) primary key, name char(30) not null, fname char(30),
mname char(30), dob date, cno int(12), ut1 int(3), hy int(3), ut2 int(3), final int(3))")
mydb.close()
ss.close()
print("\n\n\n")
def insert():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='school_manageme
nt')
ss=mydb.cursor()
insertrecord="insert into student (rno,name,fname,mname,dob,cno)values(%s,%s,%s,%s,%s,%s)"
rno=int(input("\t\t\t\t\tEnter Roll No :"))
name=input("\t\t\t\t\tEnter Student Name :")
fname=input("\t\t\t\t\tEnter Father Name :")
mname=input("\t\t\t\t\tEnter Mother Name :")
dob=input("\t\t\t\t\tEnter Date of Birth as YYYY-MM-DD :")
cno=input("\t\t\t\t\tEnter Contact No :")
ss.execute(insertrecord,(rno,name,fname,mname,dob,cno))
mydb.commit()
mydb.close()
ss.close()
print("\n\n\n")
def update():
8
SCHOOL MANAGEMENT SYSTEM
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='school_manageme
nt')
ss=mydb.cursor()
rno=int(input("\t\t\t\t\tEnter Roll No :"))
print("\t\t\t\t\tEnter 1 to Change Student Name")
print("\t\t\t\t\tEnter 2 to Change Student Father Name")
print("\t\t\t\t\tEnter 3 to Change Student Mother Name")
print("\t\t\t\t\tEnter 4 to Change Student Contact No")
print("\t\t\t\t\tEnter 5 to Change Student Date Of Birth")
ch=input("\t\t\t\tEnter Your Choice")
if ch=='1':
name=input("\t\t\t\t\tEnter Correct Name of Student :")
ud="update student set name=%s where rno=%s"
ss.execute(ud,(name,rno))
elif ch=='2':
fname=input("\t\t\t\t\tEnter Correct Name of Father :")
ud="update student set fname=%s where rno=%s"
ss.execute(ud,(fname,rno))
elif ch=='3':
mname=input("\t\t\t\t\tEnter Correct Name of Mother :")
ud="update student set mname=%s where rno=%s"
ss.execute(ud,(mname,rno))
elif ch=='4':
cno=input("\t\t\t\t\tEnter Correct Contact No :")
ud="update student set cno=%s where rno=%s"
ss.execute(ud,(cno,rno))
elif ch=='5':
dob=input("\t\t\t\t\tEnter Correct Date Of Birth :")
ud="update student set dob=%s where rno=%s"
ss.execute(ud,(dob,rno))
else:
print("\t\t\t\t\tYour Choice is Wrong")
mydb.commit()
print("\t\t\t\t\tRecord is succesfully updated")
print("\n\n\n")
mydb.close()
ss.close()
def delete():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='school_manageme
nt')
ss=mydb.cursor()
rno=input("\t\t\t\t\tEnter Roll No :")
deleterec="delete from student where rno=%s"
ss.execute(deleterec,(rno,))
mydb.commit()
9
SCHOOL MANAGEMENT SYSTEM
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='school_manageme
nt')
ss=mydb.cursor()
rno=input("\t\t\t\t\tEnter Roll No :")
record="select * from student where rno=%s"
ss.execute(record,(rno,))
rec=ss.fetchall()
for x in rec:
print("Roll No\tStudent Name\tFather Name\tMother Name\tDate Of Borth\tContact No\tUnit
Test1\tHalf Yearly\tUnit Test2\tFinal")
print(x[0],"\t",x[1],"\t",x[2],"\t",x[3],"\t",x[4],"\t",x[5],"\t",x[6],"\t\t",x[7],"\t\t",x[8],"\t\t",x[9])
mydb.close()
ss.close()
print("\n\n\n")
def showall():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='school_manageme
nt')
ss=mydb.cursor()
record="select * from student"
ss.execute(record)
rec=ss.fetchall()
print("Roll No\tStudent Name\tFather Name\tMother Name\tDate Of Borth\tContact No\tUnit Test1\
tHalf Yearly\tUnit Test2\tFinal")
for x in rec:
print(x[0],"\t",x[1],"\t",x[2],"\t",x[3],"\t",x[4],"\t",x[5],"\t",x[6],"\t\t",x[7],"\t\t",x[8],"\t\t",x[9])
mydb.close()
ss.close()
print("\n\n\n")
def marks():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='school_manageme
nt')
ss=mydb.cursor()
rno=int(input("Enter Roll No :"))
print("\t\t\t\t\tEnter 1 to Insert Marks of Unit Test 1 :")
print("\t\t\t\t\tEnter 2 to Insert Marks of Half Yearly :")
print("\t\t\t\t\tEnter 3 to Insert Marks of Unit Test 2 :")
print("\t\t\t\t\tEnter 4 to Insert Marks of Final :")
ch=input("\t\t\t\t\tEnter Your Choice")
if ch=='1':
10
SCHOOL MANAGEMENT SYSTEM
//***********************************************************************//
// END OF CODE //
//**********************************************************************//
11
SCHOOL MANAGEMENT SYSTEM
Program Output
12
SCHOOL MANAGEMENT SYSTEM
13
SCHOOL MANAGEMENT SYSTEM
14
SCHOOL MANAGEMENT SYSTEM
Bibliography
Sumita Arora
Preeti Arora
google.com
15