Project Docs

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 31

Python Code

import mysql.connector as sq
#PROGRAM FOR DATABASE CONNECTIVITY
def connect():
db=sq.connect(host='localhost',user='root',passwd='9315',database='schoolmgt')
if db.is connected==False:
print("not connected")
return db

#PROGRAM FOR USING SCHOOL MANAGEMENT

def select():
print("-----------------------WELCOME TO SCHOOL
MANAGEMENT-------------------------")
print("1.STUDENT MANAGEMENT")
print("2.EMPLOYEE MANAGEMENT")
print("3.DISPLAY FEE")
print("4.ATTENDANCE MANAGEMENT")
print("5.DISPLAY SCHOOL DETAILS")

ch=int(input("enter your choice(1-5):-"))


if ch==1:
print("\n------------------WELCOME TO STUDENT MANAGEMENT------------------\
n")
print("a.NEW ADMISSION")
print("b.UPDATE DETAILS")
print("c.ISSUE TC")
print("\nEXISTING RECORDS ARE\n")
def displayst():
con=connect()
cur=con.cursor()
cur.execute("select * from st")
for i in cur.fetchall():
admno=i[0]
name=i[1]
clas=i[2]
city=i[3]
dob=i[4]
print("(admno=%d,name=%s,class=%s,city=%s,dob=%s)"%
(admno,name,clas,city,dob))
displayst()
c=input("enter your choice(a-c):-")
if c=='a':
def insertst():
name=input("enter student name:-")
admno=int(input("enter admission number:-"))
clas=input("enter class:-")
city=input("enter city:-")
dob=input("enter date of birth(year-month-time):-")
con=connect()
cur=con.cursor()
cur.execute("insert into
st(name,admno,class,city,dob)values('%s','%d','%s','%s','%s')"%(name,admno,clas,city,dob))
con.commit()

insertst()
print("MODIFIED RECORDS ARE")
displayst()

elif c=='b':
def updatest():
con=connect()
cur=con.cursor()
clas=input("ENTER NEW CLASS:-")
admno=int(input("ENTER ADMISSION NO. :-"))
cur.execute("update st set class=%s where admno=%d"%(clas,admno))
con.commit()

updatest()
print("\nMODIFIED DETAILS ARE:-\n")
displayst()
elif c=='c':
def deletest():
con=connect()
cur=con.cursor()
admno=int(input("ENTER ADMISSION NO. TO BE DELETED:-"))
ans=input("ARE YOU SURE YOU WANT TO DELETE(y/n):-")
if ans=='y' or ans=='Y':
cur.execute("delete from st where admno=%d"%(admno))
con.commit()

deletest()
print("\nMODIFIED DETAILS ARE:-\n")
displayst()

elif ch==2:
print("/n------------------WELCOME TO EMPLOYEE------------------/n")
print("a. NEW EMPLOYEE")
print("b. UPDATE STAFF DETAILS")
print("c. DELETE EMPLOYEE")
e=input("enter your choice(a-c)")
print("\nEXISTING RECORDS ARE\n")
def displayemp():
con=connect()
cur=con.cursor()
cur.execute("select * from emp")
for i in cur.fetchall():
empno=i[0]
name=i[1]
job=i[2]
hiredate=i[3]
print("(empno=%d,name=%s,job=%s,hiredate=%s)"%(empno,name,job,hiredate))

displayemp()
if e=='a':
def insertemp():
empno=int(input("enter empno:-"))
name=input("enter employee name:-")
job=input("enter designation:-")
hiredate=input("enter hiredate(year-month-time):-")
con=connect()
cur=con.cursor()
cur.execute("insert into
emp(empno,name,job,hiredate)values('%d','%s','%s','%s')"%(empno,name,job,hiredate))
con.commit()

insertemp()

def displayemp():
con=connect()
cur=con.cursor()
cur.execute("select * from emp")
for i in cur.fetchall():
empno=i[0]
name=i[1]
job=i[2]
hiredate=i[3]
print("(empno=%d,name=%s,job=%s,hiredate=%s)"%(empno,name,job,hiredate))

print("\nMODIFIED RECORDS ARE\n")


displayemp()
elif e=='b':
def updateemp():
con=connect()
cur=con.cursor()
job=input("ENTER NEW JOB:-")
empno=int(input("ENTER EMPLOYEE NO:-"))
cur.execute("update emp set job='%s' where empno=%d"%(job,empno))
con.commit()

updateemp()
print("\nMODIFIED RECORDS ARE\n")
displayemp()
elif e=='c':
def deleteemp():
con=connect()
cur=con.cursor()
d=int(input("ENTER EMPNO TO BE DELETED:-"))
ans=input("ARE YOU SURE YOU WANT TO DELETE RECORD(y/n):-")
if ans=='y' or ans=='Y':
cur.execute("delete from emp where empno=%d"%(d))
con.commit()

deleteemp()
print("\nMODIFIED RECORDS ARE\n")
displayemp()

elif ch==3:
print("\n--------------WELCOME TO DISPLAY FEES------------------\n")
print("a.INSERT FEES")
print("b.UPDATE FEES")
print("c.EXEMPT FEES")
print("\n EXISTING RECORDS ARE:-\n")
def displayfee():
con=connect()
cur=con.cursor()
cur.execute("select * from fees")
for i in cur.fetchall():
admno=i[0]
fees=i[1]
monthunpaid=i[2]
print("(admno=%d,fees=%f,monthunpaid=%s)"%(admno,fees,monthunpaid))

displayfee()
f=input("ENTER YOUR CHOICE(a-c):-")
if f=='a':
def insertfee():
admno=int(input("ENTER ADMISSION NO. :-"))
fees=float(input("ENTER AMOUNT OF FEES TO BE PAID:-"))
monthunpaid=input("ENTER MONTH OF WHICH FEES TO BE PAID:-")
con=connect()
cur=con.cursor()
cur.execute("insert into fees(admno,fees,monthunpaid) values ('%d','%f','%s')"%
(admno,fees,monthunpaid))
con.commit()

insertfee()
print("\nMODIFIED RECORDS ARE:-\n")
displayfee()

elif f=='b':
def updatefee():
month=input("ENTER MONTH TO BE UPDATED:-")
admno=int(input("ENTER ADMISSION NO.:-"))
con=connect()
cur=con.cursor()
cur.execute("update fees set monthunpaid='%s'where admno=%d"%
(month,admno))
con.commit()

updatefee()
print("\nMODIFIED RECORDS ARE\n")
displayfee()

elif f=='c':
def deletefee():
admo=int(input("ENTER ADMISSION NO.:-"))
a=input("ENTER ARE YOU SURE YOU WANT TO EXEMPT FEE(y/n):-")
con=connect()
cur=con.cursor()
if a=='Y' or a=='y':
cur.execute("delete from fees where admno=%d"%(admo))
con.commit()
deletefee()
print("\nMODIFIED RECORDS ARE\n")
displayfee()

elif ch==4:
print("\n------------------WELCOME TO ATTENDANCE
MANAGEMENT------------------\n")
print("a.INSERT DETAILS")
print("b.UPDATE DETAILS")
print("c.DELETE DETAILS")
print("\nEXISTING DETAILS ARE:-")
def displayatt():
con=connect()
cur=con.cursor()
cur.execute("select * from attendance")
for i in cur.fetchall():
admno=i[0]
name=i[1]
present=i[2]
totalpresent=i[3]
per=i[4]
print("(admno=%d,name=%s,present=%d,totalpresent=%d,per=%f)"%
(admno,name,present,totalpresent,per))
displayatt()
a=input("enter your choice")
if a=='a':
def insertatt():
admno=int(input("ENTER ADMISSION NO.:-"))
name=input("ENTER STUDENT NAME:-")
present=int(input("ENTER CLASS ATTENDED DURING THE YEAR:-"))
totalpresent=int(input("ENTER TOTAL CLASS ATTENDED DURING THE
YEAR:-"))
per=float(input("ENTER PERCENTAGE:-"))
con=connect()
cur=con.cursor()
cur.execute("insert into attendance(admno,name,present,totalpresent,per) values
('%d','%s','%d','%d','%f')"%(admno,name,present,totalpresent,per))
con.commit()

insertatt()
print("\nMODIFIED DETAILS ARE:-\n")
displayatt()

elif a=='b':
def updateatt():
present=int(input("ENTER CLASS ATTENDED DURING THE YEAR:-"))
per=float(input("ENTER PERCENTAGE:-"))
admno=int(input("ENTER ADMISSION NO.:-"))
con=connect()
cur=con.cursor()
cur.execute("update attendance set present='%d',per='%f' where admno='%d'"%
(present,per,admno))
con.commit()

updateatt()
print("\nMODIFIED DETAILS ARE:-\n")
displayatt()

elif a=='c':
def deleteexam():
admno=int(input("ENTER ADMISSION NO.:-"))
f=input("ARE YOU SURE YOU WANT TO DELETE(y/n):-")
con=connect()
cur=con.cursor()
if f=='y' or f=='Y':
cur.execute("delete from attendance where admno='%d'"%(admno))
con.commit()

deleteexam()
print("\nMODIFIED DETAILS ARE:-\n")
displayatt()

elif ch==5:
print("\n------------------WELCOME TO DISPLAY SCHOOL RELATED
DETAILS------------------\n")
print("a.INSERT DETAILS")
print("b.UPDATE DETAILS")
print("c.DELETE DETAILS")
print("\nEXISTING DETAILS ARE:-\n")
def displaysc():
con=connect()
cur=con.cursor()
cur.execute("select * from school")
for i in cur.fetchall():
sid=i[0]
sname=i[1]
noofstudent=i[2]
noofemployee=i[3]
nooflabs=i[4]
print("(id=%d,sname='%s',noofstudent=%d,noofemployee=%d,nooflabs=%d)"%
(sid,sname,noofstudent,noofemployee,nooflabs))
displaysc()
s=input("ENTER YOUR CHOICE")
if s=='a':
def insertsc():
sid=int(input("ENTER SCHOOL ID:-"))
sname=input("ENTER SCHOOL NAME:-")
noofstudent=int(input("ENTER NUMBER OF STUDENT:-"))
noofemployee=int(input("ENTER NUMBER OF EMPLOYEE:-"))
nooflabs=int(input("ENTER NUMBER OF LABS:-"))
con=connect()
cur=con.cursor()
cur.execute("insert into
school(id,sname,noofstudent,noofemployee,nooflabs)values(%d,'%s',%d,%d,%d)"%
(sid,sname,noofstudent,noofemployee,nooflabs))
con.commit()

insertsc()
print("\nMODIFIED DETALIS ARE:-\n")
displaysc()

elif s=='b':
def updatesc():
noofstudent=int(input("ENTER NUMBER OF STUDENT:-"))
noofemployee=int(input("ENTER NUMBER OF EMPLOYEE:-"))
nooflabs=int(input("ENTER NUMBER OF LABS:-"))
sid=int(input("ENTER SCHOOL ID:-"))
con=connect()
cur=con.cursor()
cur.execute("update school set noofstudent=%d,noofemployee=%d,nooflabs=%d
where id=%d"%(noofstudent,noofemployee,nooflabs,sid))
con.commit()

updatesc()
print("\nMODIFIED DETALIS ARE:-\n")
displaysc()

elif s=='c':
def deletesc():
sid=int(input("ENTER SCHOOL ID:-"))
con=connect()
cur=con.cursor()
cur.execute("delete from school where id=%d"%(sid))
con.commit()

deletesc()
print("\nMODIFIED DETALIS ARE:-\n")
displaysc()

d=input("DO YOU WANT TO USE THE DATABASE AGAIN(y/n)")


if d=='y'or d=='Y':
select()
elif d=='n' or d=='N':
print("\n------------------THANKS FOR VISITING SCHOOL
MANAGEMENT------------------\n")

select()
CERTIFICATE
This is to certify that Saksham
Goyal of class XII A of Modern
Public School has completed her
project file under the supervision of
Mrs. Neeru Sharma she has taken
care and shown sincerity in
completion of this project

Internal External
examiner examiner
Acknowledgment
I would like to express my greatest gratitude
to the people who helped and supported me
throughout my project. I am thankful to my
parents for helping me in completion of this
project. I ama grateful to Mrs. Neeru Sharma
whose valuable guidance has been the ones
that helped me patch this project and make it
full proof success. I would also like to express
my gratitude to the principal for his constant
motivation during the course of this
investigation

Name: SAKSHAM GOYAL


Class: XII A
Index
S.N TOPICS
O
1 Introduction

2 Software and Hardware Requirements

3 Advantages of his Project

4 Source code in Python

5 Output screen

6 My SQl Table

7 Limitations

8 Future Scopes

9 Bilbiography
Introduction
This project work automates school management system. School Management
System consist of tasks such registering students, attendance record keeping
control to absentees, details of teacher, fee structure, etc. Data file handling has
been effectively wed in the program. Database is a collection of interrelated data
to serve multiple application is database programs create files of information. So
we see that files are worked with most inside the program itself.
DBMS: The software required for management of data is called DBMS. It has
three models.
RELATION MODEL: It stores information in form of row (cardinality) and
columns(degree)
HIERARCHICAL MODEL: In this type of model, we have multiple records
inside a single record NETWORK MODEL: In this, the data is represented by
collections of record and relationships is separated by associations.
CHARACTERISTICS OF DBMS:
• It reduces the redundancy.
• Data sharing
• Data standardization
• Reduction of data inconsistency
TYPES OF FILES BASED ON ACCESS
• Sequential file
• Serial file
• Random file
• Test file
• Binary file
ADVANTAGES OF
PROJECT
• Saves time of teachers and administrators.
• Improving Teaching Standards.
• Complete attendance automation.
• Effortless grades and marks
management.
• Publishing of online forums and assignments.
• Easy management of class information analytical
reports.
• Ordering books for library accordingly.
SOFTWARE AND HARDWARE
REQUIREMENT
 SOFTWARE SPECIFICATION
• Operating system: Window10/8/7
• Platform: Python IDLE3.7
• Database: MySQL
• Languages : Python

 HARDWARE SPECIFICATION
• Processor: Dual core or
above
• Hard Disk: 40GB
• RAM: 1024
Output
MY SQL Tables
 FOR CREATING TABLE
create database schoolmgt;
create table st
(admno int primary key,
name varchar(20),
class varchar(20),
city varchar(20),
dob date);
create table emp
(empno int primary key,
name varchar(20),
job varchar(20),
hiredate date);
create table fees
(admno int primary key,
fees float,
monthunpaid varchar(20));
create table attendance
(admno int primary key,
name varchar(20),
present int,
totalpresent int,
per float);
create table school
(id integer primary key,
sname varchar(20),
noofstudent int,
noofemployee int,
nooflabs int);
LIMITATIONS
• The limitations of the application is more
improvements in online examinations.
Limited questions had been stored and need
more updation and maintenance of the
application.
• Storage capacity is too small so that it
cannot be stored large amount of data so that
backup is necessary for the future
improvement.
FUTURE SCOPE
• In future our system can include accounting
system, good backup, and restore facility.
• System is so much flexible so in future it can
increase easily and new modules can be added
easily.
• You can add student admission as well as
pay online fees.
• Make online exams more effective, efficient
and more dynamic so that it helps to get good
support from the student.
BIBLIOGRAPH
Y
• Computer science with Sumita Arora
• Computer science with Preeti Arora
• www.wikipedia.org
www.w3resource.com
• Under the guidance of subject teacher

You might also like