Main Cs Project
Main Cs Project
D.A.V PUBLIC
SCHOOL,ALKUSHA
2024-25
COMPUTER SCIENCE
( PYTHON NEW )
A PROJECT REPORT ON
SCHOOL MANAGEMENT
(CLASS :12TH)
ALOK SUMAN
2024-25
Table of
contents
Acknowledgement
Certificate
Introduction
Requirements
Python Coding with Mysql
Connectivity
Output
Bibliography
ALOK SUMAN
2024-25
Acknowledgement
I would like to express my sincere
gratitude to my computer teacher
Mrs.Vikash Kumar for her vital support ,
guidance and encouragement and
without this project would not have
come forth . I would like to express my
gratitude to the staff of the
Department of Computer Science at
D.A.V Public School ,Alkusha for their
support during the making of this
project.
ASHISH RAM
ALOK SUMAN
2024-25
Class12th A
Certificate
This is to certified that Aditya singh of
class 12th has successfully completed
her research on the project entitled
‘School Management’ under the
guidance of Mr. Vikash Kumar during
the year 2024-2025. For the
fulfilment of AISSCE Practical
Examination conducted by CBSE Board.
Project Coordinator
(Department of Computer Science)
ALOK SUMAN
2024-25
INTRODUCTION
The students can login to their accounts and can do lot of things like scheduling
works, checking assignment submission dates and they can communicate with each other.
Discussion forums are provided for discussion among students.
The parents can login and can follow the progress of their child's activities. They can
check the mark list, attendance of their child, and the comments of their teachers about their
child. They can also communicate with the faculties through the she.
The faculties can login to their accounts and do several things like adding marks of
the students, adding comment about the students, checking their scheduled jobs from the
management or principal.
The management staff as well as the principal can manage the faculties as well as the
students. The personnel can add new faculty, delete a faculty, can change the details of
faculty including the wage and other details.
ALOK SUMAN
2024-25
Requiremen
ts
HARDWARE REQUIRED
Printer (to print the required documents of the project)
Compact Disc and Drive
Processor: Intel Pentium Quadcore
Ram: 2GB
Hard Disk : 120GB
SOFTWARE REQUIRED
Operating system: Windows–7/10, MacOS, Linux / Ubuntu
Python IDE (for execution)
MySQL
MS Word (for presentation of output)
ALOK SUMAN
2024-25
User: root
Password: tiger
Database : MySQL
ALOK SUMAN
2024-25
Table: Student
Table: MP
ALOK SUMAN
2024-25
Table: Fee
ALOK SUMAN
2024-25
Table: Exam
ALOK SUMAN
2024-25
Python Code:
import os
import platform
import MySQL. Connector
#import pandas as pd
#from pandas import Data Frame
def selection ():
db = mysql. connector.connect(user='root', password='tiger',
host='localhost',database='mysql')
cursor = db.cursor()
print ('-----------------------------------\nWELCOME TO SCHOOL
MANAGEMENT SYSTEM\n-----------------------------------')
print ("1.STUDENT MANAGEMENT")
print ("2.EMPLOYEE MANAGEMENT")
print ("3.FEE MANAGEMENT")
print ("4.EXAM MANAGEMENT")
ch= int(input(" \nEnter ur choice (1-4) : "))
if ch == 1:
print ('\nWELCOME TO STUDENT MANAGEMENT SYSTEM\n')
ALOK SUMAN
2024-25
ALOK SUMAN
2024-25
elif ch==2:
print ('WELCOME TO EMPLOYEE MANAGEMENT SYSTEM')
print ('a.NEW EMPLOYEE')
print ('b.UPDATE STAFF DETAILS')
print ('c.DELETE 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...!!')
ALOK SUMAN
2024-25
elif ch==3:
print ('WELCOME TO FEE MANAGEMENT SYSTEM')
print ('a.NEW FEE')
print ('b.UPDATE FEE')
print ('c.EXEMPT 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 ('a.EXAM DETAILS')
print ('b.UPDATE DETAILS ')
print ('c.DELETE DETAILS')
c=input("Enter ur choice : ")
ALOK SUMAN
2024-25
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 = mysql.connector.connect(user='root', password='tiger',
host ='localhost',database='mysql')
cursor = db.cursor()
ALOK SUMAN
2024-25
ALOK SUMAN
2024-25
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")
db.close()
def update1():
try:
db = mysql.connector.connect(user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM student"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
admno= c[1]
ALOK SUMAN
2024-25
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)
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
def delete1():
try:
db = mysql.connector.connect(user='root', password='tiger',
host = 'localhost',database='mysql')
ALOK SUMAN
2024-25
cursor = db.cursor()
sql = "SELECT * FROM student"
cursor.execute(sql)
results = cursor.fetchall()
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':
cursor.execute(sql)
db.commit()
ALOK SUMAN
2024-25
except Exception as e:
print (e)
db.close()
def insert2():
ename = input("Enter Employee Name : ")
empno = int(input("Enter Employee No : "))
job = input("Enter Designation: ")
hiredate = input("Enter date of joining: ")
db = mysql.connector.connect(user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = db.cursor()
sql = "INSERT INTO emp(ename,empno,job,hiredate) VALUES
( '%s' ,'%d','%s','%s')"%(ename,empno,job,hiredate)
try:
cursor.execute(sql)
db.commit()
except:
db.rollback()
db.close()
def display2():
ALOK SUMAN
2024-25
try:
db = mysql.connector.connect(user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM emp"
cursor.execute(sql)
results = cursor.fetchall()
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")
db.close()
def update2():
try:
ALOK SUMAN
2024-25
db = mysql.connector.connect(user='root', password='tiger',
host = 'localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM emp"
cursor.execute(sql)
results = cursor.fetchall()
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)
cursor.execute(sql)
ALOK SUMAN
2024-25
db.commit()
except Exception as e:
print (e)
db.close()
def delete2():
try:
db = mysql.connector.connect(user='root', password='tiger',
host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROMemp"
cursor.execute(sql)
results = cursor.fetchall()
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 : "))
ALOK SUMAN
2024-25
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':
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
def insert3():
admno = int(input("Enter adm no: "))
fee = float(input("Enter fee amount : "))
month = input("Enter Month: ")
db = mysql.connector.connect(user='root', password='tiger',
host='localhost',database='mysql')
cursor = db.cursor()
sql = "INSERT INTO fee(admno,fee,month) VALUES
( '%d','%d','%s')"%(admno,fee,month)
try:
ALOK SUMAN
2024-25
cursor.execute(sql)
db.commit()
except:
db.rollback()
db.close()
def display3():
try:
db = mysql.connector.connect(user='root', password='tiger',
host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM fee"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
admno= c[0]
fee=c[1]
month=c[2]
print ("(admno=%d,fee=%s,month=%s)" %
(admno,fee,month))
except:
ALOK SUMAN
2024-25
ALOK SUMAN
2024-25
ALOK SUMAN
2024-25
ALOK SUMAN
2024-25
ALOK SUMAN
2024-25
cls=c[3]
cty=c[4]
print ("(sname,admno,per,res)"%(sname,admno,per,res) )
except:
print ("Error: unable to fetch data")
db.close()
def update4():
try:
db = mysql.connector.connect(user='root', password='tiger',
host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM exam"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
ALOK SUMAN
2024-25
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)
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
def delete4():
try:
db = mysql.connector.connect(user='root', password='tiger',
host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM exam"
cursor.execute(sql)
ALOK SUMAN
2024-25
results = cursor.fetchall()
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':
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
ALOK SUMAN
2024-25
selection()
OUTPUT:
INSERT DETAILS
ALOK SUMAN
2024-25
UPDATE DETAILS
ALOK SUMAN
2024-25
DELETE DETAILS
ALOK SUMAN
2024-25
Bibliograph
y
Text book by Sumita Arora
Wikipedia
Google Search
www.pythontrends.wordpress.com
ALOK SUMAN