0% found this document useful (0 votes)
6 views35 pages

CS Project File 2020-21 (2) FFFFFFF

The document is a project report for a School Management system developed in Python, utilizing MySQL for data management. It includes sections such as a certificate of completion, acknowledgments, an introduction to the project, and coding details. The system allows for managing student accounts, attendance, marks, and fee payments, with a user-friendly interface.

Uploaded by

aakashlohiya2102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views35 pages

CS Project File 2020-21 (2) FFFFFFF

The document is a project report for a School Management system developed in Python, utilizing MySQL for data management. It includes sections such as a certificate of completion, acknowledgments, an introduction to the project, and coding details. The system allows for managing student accounts, attendance, marks, and fee payments, with a user-friendly interface.

Uploaded by

aakashlohiya2102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 35

Computer SCIENCE

Project REPORT
[PYTHON]
SCHOOL MANAGEMENT
submitted By

Name : ________________________class _______ roll No._____


Session : 2020-21
CERTIFICATE
This is to certify that

Master _____________________ Roll No _____

And
Master _____________________ Roll No _____

of Delhi Public School , Gandhinagar have


successfully completed their Computer
Project entitled

“ SCHOOL
MANAGEMENT ”
as per the requirement of CBSE.
Signature of Signature of
Signature of

Internal Examiner External Examiner


Principal

Acknowledgement
It gives us great pleasure and deep satisfaction in
presenting the project towards the fulfillment of practical
knowledge in Python and Python-MySQL Connectivity.

We would like to express our sincere gratitude to


several people with whose help and encouragement, we
have been able to complete this project successfully.

We would like to thank Mr. Samir Parmar, our


Computer Science teacher, for his guidance, valuable
suggestions and continuous encouragement which led to
the accomplishment of this project. We wish to put our
deepest sense of appreciation and thanks to him. We
express our deepest gratitude to Mr. Atanu Rath, Principal
DPS Gandhinagar, for his continuous guidance and
motivation and also for extending all the necessary
facilities required which led to the accomplishment of this
project.

We are also very grateful to our parents for their


constant and loving support. Finally, we also wish to
express a word of thanks to all our fellow students and all
those directly or indirectly involved in our project for their
help and cooperation.

TABLE OF CONTENTS

 Certificate

 Acknowledgement

 Introduction

 Imported libraries and their purpose

 Coding

 Outputs

 Bibliography
INTRODUCTION

This is an automated software system written in


Python programming language, using Python-MySQL
Connectivity on the topic School Management which
can handle accounts of the students. It uses MySQL to
handle the details, marks and fees of the students. It
has a nice graphical layout written in Python
Language.

It can add new student accounts and edit the


existing ones and it also helps in viewing the details,
like attendance and aggregate percentage and stream
for those who belong to class 11 and 12, and also the
marks of the students in their respective (chosen)
subjects by entering their admission number. It helps
in the payment of the fee and also helps in modifying
the incorrect data of the student. It also gives an
option to apply for TC, for which it requires the name
of the student for confirmation. Overall, it has all the
major functions which can be used without any
interruptions.

Libraries USED AND


THEIR PURPOSE

1. time - provides many ways of


representing time in code, such as objects,
numbers, and strings.

2. datetime - provide a number of functions to deal


with dates, times and time intervals.

3.Mysql.Connector – To connect Python with


MySQL database

4.Tabulate – for displaying data in a tabular format


CODING
/SCHOOL MANAGEMENT PROJECT- By Harsh Lohiya, XII B &
Vatsal Patel , XII B

import time
import datetime
import mysql.connector as cn
from tabulate import tabulate

# password for admin- harsh


# password for accountant- vatsal

con=cn.connect(host="localhost",user="root",password="1234")
cur=con.cursor()

cur.execute("create database if not exists project")


cur.execute("use project")
cur.execute('''CREATE table if not exists details(Admn_no int(4) primary key,
Name varchar(20) not null,
Class int(2) not null,
Section char(1) not null,
Attendance float,
Stream Varchar(12),
Note varchar(15))''')
cur.execute('''CREATE table if not exists Payment(Admn_no int(4) primary key,
Name varchar(20) not null,
Quarter1 varchar(10) not null,
Quarter2 varchar(10) not null,
Quarter3 varchar(10) not null,
Quarter4 varchar(10) not null)''')
cur.execute('''CREATE table if not exists Academic_Sec(Admn_no int(4) primary key,
Name varchar(20) not null,
Maths float(4,1),
Science float(4,1),
Social_Science float(4,1),
English float(4,1),
Hindi float(4,1),
Sanskrit float(4,1),
French float(4,1),
Aggregate float(4,1))''')
cur.execute('''CREATE table if not exists Academic_Sci(Admn_no int(4) primary key,
Name varchar(20) not null,
Physics float(4,1),
Chemistry float(4,1),
English float(4,1),
Maths float(4,1),
Biology float(4,1),
Computer_Science float(4,1),
PE float(4,1),
Aggregate float(4,1))''')
cur.execute('''CREATE table if not exists Academic_Com(Admn_no int(4) primary key,
Name varchar(20) not null,
Business_Studies float(4,1),
Economics float(4,1),
English float(4,1),
Accountancy float(4,1),
Computer_Science float(4,1),
Maths float(4,1),
PE float(4,1),
Aggregate float(4,1))''')
con.commit()

p1="harsh"
p2="vatsal"

for a in range (33,101,33):


print("LOADING...",a,"%")
print()
time.sleep(1)

now=datetime.datetime.now()
print("The current date and time is :")
print(now.strftime("%d-%m-%Y %H:%M:%S"))
print("\t\t\t\t *********************")
print("\t\t\t\t DPS Gandhinagar")
print("\t\t\t\t *********************")
print()
while True:
print("*********************")
print(" MAIN MENU")
print("*********************")
print("1. Admin")
print("2. User")
print("3. Accountant")
print("4. Exit")
print()
a1=int(input("Enter your required command:"))
print()
if a1==1:
a2=input("Enter password:")
print()
while a2==p1:
print("1. Add")
print("2. Modify")
print("3. Search")
print("4. Display all student record")
print("5. Delete")
print("6. Back to main menu")
print()
b1=int(input("Enter your required command:"))
print()
if b1==1:
try:
c1=int(input("Enter Admission no. of the new entry:"))
query="select admn_no from details"
cur.execute(query)
myrecord=cur.fetchall()
cb1=(c1,)
if cb1 in myrecord:
print("Admission no already exist")
print()
else:
c2=input("Enter Full Name of the new student:")
c3=int(input("Enter Class of the new student:"))
c4=input("Enter Section of the new student:")
print()
if c3==9 or c3==10:
print("1. Hindi")
print("2. Sanskrit")
print("3. French")
c5=int(input("Enter the second language chosen:"))
rec=(c1,c2,c3,c4)
query="insert into details(admn_no,name,class,section) values(%s,%s,%s,%s)"
cur.execute(query,rec)
con.commit()
if c5==1:
print()
ca1=int(input("Enter the marks in Maths:"))
ca2=int(input("Enter the marks in Science:"))
ca3=int(input("Enter the marks in Social Science:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Hindi:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_sec(admn_no, name, maths, science, social_science,
english, hindi, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c5==2:
print()
ca1=int(input("Enter the marks in Maths:"))
ca2=int(input("Enter the marks in Science:"))
ca3=int(input("Enter the marks in Social Science:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Sanskrit:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_sec(admn_no, name, maths, science, social_science,
english, sanskrit, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c5==3:
print()
ca1=int(input("Enter the marks in Maths:"))
ca2=int(input("Enter the marks in Science:"))
ca3=int(input("Enter the marks in Social Science:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in French:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_sec(admn_no, name, maths, science, social_science,
english, french, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
else:
print("Enter a valid command")
elif c3>=6 and c3<=8:
print("1. French")
print("2. Sanskrit")
c5=int(input("Enter the third language chosen:"))
rec=(c1,c2,c3,c4)
query="insert into details(admn_no,name,class,section) values(%s,%s,%s,%s)"
cur.execute(query,rec)
con.commit()
if c5==1:
print()
ca1=int(input("Enter the marks in Maths:"))
ca2=int(input("Enter the marks in Science:"))
ca3=int(input("Enter the marks in Social Science:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Hindi:"))
ca6=int(input("Enter the marks in French:"))
ca7=ca1+ca2+ca3+ca4+ca5+ca6
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6,ca7)
query1="insert into academic_sec(admn_no, name, maths, science, social_science,
english, hindi, french, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c5==2:
print()
ca1=int(input("Enter the marks in Maths:"))
ca2=int(input("Enter the marks in Science:"))
ca3=int(input("Enter the marks in Social Science:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Hindi:"))
ca6=int(input("Enter the marks in Sanskrit:"))
ca7=ca1+ca2+ca3+ca4+ca5+ca6
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6,ca7)
query1="insert into academic_sec(admn_no, name, maths, science, social_science,
english, hindi, sanskrit,aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
else:
print("Enter a valid command")
elif c3==11 or c3==12:
print("1. Science")
print("2. Commerce")
c6=int(input("Enter the stream of the student:"))
if c6==1:
rec=(c1,c2,c3,c4,"Science")
query="insert into details(admn_no,name,class,section, stream) values(%s,%s,%s,%s,
%s)"
cur.execute(query,rec)
con.commit()
c7=int(input("Enter the subject chosen among (1. Biology/ 2. Maths):"))
if c7==1:
c8=int(input("Enter the chosen subject among (1. Computer Science/ 2. PE):"))
if c8==1:
print()
ca1=int(input("Enter the marks in Physics:"))
ca2=int(input("Enter the marks in Chemistry:"))
ca3=int(input("Enter the marks in Biology:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Computer Science:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_sci(admn_no, name, physics, chemistry, biology,
english, computer_science, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c8==2:
print()
ca1=int(input("Enter the marks in Physics:"))
ca2=int(input("Enter the marks in Chemistry:"))
ca3=int(input("Enter the marks in Biology:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in PE:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_sci(admn_no, name, physics, chemistry, biology,
english, pe, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c7==2:
c8=int(input("Enter the chosen subject among (1. Computer Science/ 2. PE):"))
if c8==1:
print()
ca1=int(input("Enter the marks in Physics:"))
ca2=int(input("Enter the marks in Chemistry:"))
ca3=int(input("Enter the marks in Maths:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Computer Science:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_sci(admn_no, name, physics, chemistry, maths,
english, computer_science, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c8==2:
print()
ca1=int(input("Enter the marks in Physics:"))
ca2=int(input("Enter the marks in Chemistry:"))
ca3=int(input("Enter the marks in Maths:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in PE:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_sci(admn_no, name, physics, chemistry, maths,
english, pe, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c6==2:
rec=(c1,c2,c3,c4,"Commerce")
query="insert into details(admn_no,name,class,section, stream) values(%s,%s,%s,%s,
%s)"
cur.execute(query,rec)
con.commit()
c7=int(input("Enter the chosen subject among (1. Computer Science/ 2. PE/ 3.
Maths):"))
if c7==1:
print()
ca1=int(input("Enter the marks in Business Studies:"))
ca2=int(input("Enter the marks in Economics:"))
ca3=int(input("Enter the marks in Accountancy:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Computer Science:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_com(admn_no, name, business_studies, economics,
accountancy, english, computer_science, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c7==2:
print()
ca1=int(input("Enter the marks in Business Studies:"))
ca2=int(input("Enter the marks in Economics:"))
ca3=int(input("Enter the marks in Accountancy:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in PE:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_com(admn_no, name, business_studies, economics,
accountancy, english, pe, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
elif c7==3:
print()
ca1=int(input("Enter the marks in Business Studies:"))
ca2=int(input("Enter the marks in Economics:"))
ca3=int(input("Enter the marks in Accountancy:"))
ca4=int(input("Enter the marks in English:"))
ca5=int(input("Enter the marks in Maths:"))
ca6=ca1+ca2+ca3+ca4+ca5
rec1=(c1,c2,ca1,ca2,ca3,ca4,ca5,ca6)
query1="insert into academic_com(admn_no, name, business_studies, economics,
accountancy, english, maths, aggregate) values (%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(query1,rec1)
con.commit()
else:
print("Enter a valid command")
else:
print("Enter a valid command")
rec2=(c1,c2,"Paid","Not Paid","Not Paid","10/01/2021")
query2="insert into payment(admn_no, name, quarter1, quarter2, quarter3, quarter4) values
(%s,%s,%s,%s,%s,%s)"
cur.execute(query2,rec2)
con.commit()
print("Record added successfully")
print("\t\t\t *****************")
print()
except:
print("Error in adding record")
elif b1==2:
try:
d1=input("Enter admission no. of the student to be modified:")
print()
query="select * from details where admn_no= "+d1
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c>0:
d2=int(input("You want to modify which table(1. Details/ 2. Academics):"))
if d2==1:
print("Modify from Following:")
print("1. Class")
print("2. Section")
print("3. Attendance")
if myrecord[5]!=None:
print("4. Stream")
print()
d3=int(input("Enter Your Required Command:"))
print()
if d3==1:
d4=input("Enter the modified class:")
print()
query="update details set class='"+d4+"' where admn_no= "+d1
cur.execute(query)
con.commit()
elif d3==2:
d4=input("Enter the modified section:")
print()
query="update details set section='"+d4+"' where admn_no= "+d1
cur.execute(query)
con.commit()
elif d3==3:
d4=input("Enter the modified attendance:")
print()
query="update details set attendance='"+d4+"' where admn_no= "+d1
cur.execute(query)
con.commit()
elif d3==4:
d4=input("Enter the modified stream:")
print()
query="update details set stream='"+d4+"' where admn_no= "+d1
cur.execute(query)
con.commit()
elif d2==2:
if myrecord[5]==None:
query1="select * from academic_sec where admn_no="+d1
cur.execute(query1)
myrecord1=cur.fetchone()
print("Modify from Following:")
print("1. Maths")
print("2. Science")
print("3. Social Science")
print("4. English")
count=0
for i in range(6,9):
if myrecord1[i]!=None:
if i==6:
print("5. Hindi")
count+=1
s=1
elif i==7 and count==0:
print("5. Sanskrit")
count+=1
s=2
elif i==7 and count==1:
print("6. Sanskrit")
count+=1
s=1
elif i==8 and count==0:
print("5. French")
s=3
elif i==8 and count==1:
print("6. French")
s=2
elif i==8 and count==2:
print("7. French")
print()
d8=int(input("Enter Your Required Command:"))
print()
if d8==1:
print("For Maths")
d9=input("Enter the modified marks:")
print()
query2="update academic_sec set maths="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==2:
print("For Science")
d9=input("Enter the modified marks:")
print()
query2="update academic_sec set science="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==4 and s==1:
print("For Social Science")
d9=input("Enter the modified marks:")
print()
query2="update academic_sec set social_science="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==4:
print("For English")
d9=input("Enter the modified marks:")
print()
query2="update academic_sec set english="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==5 and s==1:
print("For Hindi")
d9=input("Enter the modified marks:")
print()
query2="update academic_sec set hindi="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif (d8==5 and s==2) or (d8==6 and s==1):
print("For Sanskrit")
d9=input("Enter the modified marks:")
print()
query2="update academic_sec set sanskrit="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif (d8==5 and s==3) or (d8==6 and s==2) or (d8==7):
print("For French")
d9=input("Enter the modified marks:")
print()
query2="update academic_sec set french="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif myrecord[5]=="Science":
query1="select * from academic_sci where admn_no="+d1
cur.execute(query1)
myrecord1=cur.fetchone()
print("Modify from Following:")
print("1. Physics")
print("2. Chemistry")
print("3. English")
for i in range(5,9):
if myrecord1[i]!=None:
if i==5:
print("4. Maths")
s=1
elif i==6:
print("4. Biology")
s=2
elif i==7:
print("5. Computer Science")
s=1
elif i==8:
print("5. PE")
s=2
print()
d8=int(input("Enter Your Required Command:"))
print()
if d8==1:
print("For Physics")
d9=input("Enter the modified marks:")
print()
query2="update academic_sci set physics="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==2:
print("For Chemistry")
d9=input("Enter the modified marks:")
print()
query2="update academic_sci set chemistry="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==3:
print("For English")
d9=input("Enter the modified marks:")
print()
query2="update academic_sci set english="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==4 and s==1:
print("For Maths")
d9=input("Enter the modified marks:")
print()
query2="update academic_sci set maths="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==4 and s==2:
print("For Biology")
d9=input("Enter the modified marks:")
print()
query2="update academic_sci set biology="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==5 and s==1:
print("For Computer Science")
d9=input("Enter the modified marks:")
print()
query2="update academic_sci set computer_science="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==5 and s==2:
print("For PE")
d9=input("Enter the modified marks:")
print()
query2="update academic_sci set pe="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif myrecord[5]=="Commerce":
query1="select * from academic_com where admn_no="+d1
cur.execute(query1)
myrecord1=cur.fetchone()
print("Modify from Following:")
print("1. Business Studies")
print("2. Economics")
print("3. English")
print("4. Accountancy")
for i in range(6,8):
if myrecord1[i]!=None:
if i==6:
print("5. Maths")
s=1
elif i==7:
print("5. PE")
s=2
print()
d8=int(input("Enter Your Required Command:"))
print()
if d8==1:
print("For Business Studies")
d9=input("Enter the modified marks:")
print()
query2="update academic_com set business_studies="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==2:
print("For Economics")
d9=input("Enter the modified marks:")
print()
query2="update academic_com set economics="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==3:
print("For English")
d9=input("Enter the modified marks:")
print()
query2="update academic_com set english="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==4:
print("For Accountancy")
d9=input("Enter the modified marks:")
print()
query2="update academic_com set accountacy="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==5 and s==1:
print("For Maths")
d9=input("Enter the modified marks:")
print()
query2="update academic_com set maths="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
elif d8==5 and s==2:
print("For PE")
d9=input("Enter the modified marks:")
print()
query2="update academic_com set pe="+d9+" where admn_no="+d1
cur.execute(query2)
con.commit()
else:
print("Enter a valid command")
else:
print("Entered Admission no. doesn't exist")
print("Record modified")
print("\t\t\t *****************")
print()
except:
print("Error in modifying record")
elif b1==3:
try:
e1=input("Enter Admission no. of the student to be searched:")
print()
query="select admn_no,name,class,section,IFNULL(stream,'NA'),IFNULL(note,'-') from details
where admn_no= "+e1
cur.execute(query)
myrecord=cur.fetchall()
c=cur.rowcount
if c>0:
print(tabulate(myrecord,headers=["Admn
No","Name","Class","Section","Stream","Note"],tablefmt="fancy_grid"))
else:
print("Entered Admission number doesn't exist")
print("\t\t\t *****************")
print()
except:
print("Error in searching record")
elif b1==4:
try:
print("Sort the records by which field:")
print("1. Admn no")
print("2. Class")
e2=int(input("Enter Your Required Command:"))
if e2==1:
query="select admn_no,name,class,section,IFNULL(stream,'NA'),IFNULL(note,'-') from
details order by admn_no"
cur.execute(query)
myrecord=cur.fetchall()
print(tabulate(myrecord,headers=["Admn
No","Name","Class","Section","Stream","Note"],tablefmt="fancy_grid"))
elif e2==2:
query="select admn_no,name,class,section,IFNULL(stream,'NA'),IFNULL(note,'-') from
details order by class"
cur.execute(query)
myrecord=cur.fetchall()
print(tabulate(myrecord,headers=["Admn
No","Name","Class","Section","Stream","Note"],tablefmt="fancy_grid"))
else:
print("Enter a valid command")
print("\t\t\t *****************")
print()
except:
print("Error in searching record")
elif b1==5:
try:
f1=input("Enter Admission no. of the student to be deleted:")
print()
query="select * from details where admn_no= "+f1
cur.execute(query)
myrecord=cur.fetchone()
del_class=myrecord[2]
del_stream=myrecord[5]
query1="delete from details where admn_no= "+f1
cur.execute(query1)
con.commit()
c=cur.rowcount
if c>0:
print("The details of the student has been successfully deleted")
else:
print("Entered Admission number doesn't exist")
query2="delete from payment where admn_no= "+f1
cur.execute(query2)
con.commit()
if del_class<=10:
query3="delete from academic_sec where admn_no= "+f1
cur.execute(query3)
con.commit()
else:
if del_stream=="Science":
query4="delete from academic_sci where admn_no= "+f1
cur.execute(query4)
con.commit()
else:
query5="delete from academic_com where admn_no= "+f1
cur.execute(query5)
con.commit()
print("\t\t\t *****************")
print()
except:
print("Error in deleting record")
elif b1==6:
print("\t\t\t *****************")
break
else:
print("Enter a valid command")
print("\t\t\t *****************")
else:
print("Invalid Password")
print("\t\t\t *****************")
elif a1==2:
while True:
print("1. Student Details")
print("2. Academics")
print("3. Pay Fees")
print("4. Apply for TC")
print("5. Back to main menu")
g1=int(input("Enter your required command:"))
print()
if g1==1:
try:
h1=input("Enter Admission no. of the student:")
print()
query="select admn_no,name,class,section,IFNULL(stream,'NA') from details where
admn_no= "+h1
cur.execute(query)
myrecord=cur.fetchall()
c=cur.rowcount
if c>0:
print(tabulate(myrecord,headers=["Admn
No","Name","Class","Section","Stream"],tablefmt="fancy_grid"))
else:
print("Entered Admission no. doesn't exist")
print("\t\t\t *****************")
print()
except:
print("Error in retrieving details")
elif g1==2:
try:
h2=input("Enter Admission no. of the student:")
print()
query="select * from details where admn_no= "+h2
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c>0:
if myrecord[2]<=10:
query1="select
admn_no,name,maths,science,social_science,english,IFNULL(hindi,'NA'),IFNULL(french,'NA'),IFNULL(san
skrit,'NA') from academic_sec where admn_no="+h2
cur.execute(query1)
myrecord1=cur.fetchall()
print(tabulate(myrecord1,headers=["Admn No","Name","Maths","Science","Social
Science","English","Hindi","French","Sanskrit"],tablefmt="fancy_grid"))
elif myrecord[2]>=11:
if myrecord[5]=="Science":
query1="select
admn_no,name,physics,chemistry,english,IFNULL(maths,'NA'),IFNULL(biology,'NA'),IFNULL(computer_sci
ence,'NA'),IFNULL(pe,'NA') from academic_sci where admn_no="+h2
cur.execute(query1)
myrecord1=cur.fetchall()
print(tabulate(myrecord1,headers=["Admn
No","Name","Physics","Chemistry","English","Maths","Biology","Computer
Science","PE"],tablefmt="fancy_grid"))
elif myrecord[5]=="Commerce":
query1="select
admn_no,name,business_studies,economics,accountancy,english,IFNULL(maths,'NA'),IFNULL(pe,'NA')
from academic_com where admn_no="+h2
cur.execute(query1)
myrecord1=cur.fetchall()
print(tabulate(myrecord1,headers=["Admn No","Name","Business
Studies","Economics","Accountancy","English","Maths","PE"],tablefmt="fancy_grid"))
else:
print("Entered Admission no. doesn't exist")
print("\t\t\t *****************")
print()
except:
print("Error in retrieving academic details")
elif g1==3:
try:
ab1=input("Enter Admission no. of the student:")
query="select * from details where admn_no= "+ab1
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c>0:
print("1. Quarter1")
print("2. Quarter2")
print("3. Quarter3")
print("4. Quarter4")
ab2=int(input("You want to pay fee of which quarter:"))
print()
query1="select * from payment where admn_no= "+ab1
cur.execute(query1)
myrecord1=cur.fetchone()
if ab2==1:
if myrecord1[2]=="Paid":
print("The fee of this quarter is already paid")
elif myrecord1[2]=="Not Paid":
ab3=int(input("Press 1 to pay tuition fee:"))
print()
if ab3==1:
query2="update payment set Quarter1='Paid' where admn_no="+ab1
cur.execute(query2)
con.commit()
print("Quarter1 fee paid successfully")
else:
print("Transaction Failed")
elif ab2==2:
if myrecord1[3]=="Paid":
print("The fee of this quarter is already paid")
elif myrecord1[3]=="Not Paid":
ab3=int(input("Press 1 to pay tuition fee:"))
print()
if ab3==1:
query2="update payment set Quarter2='Paid' where admn_no="+ab1
cur.execute(query2)
con.commit()
print("Quarter2 fee paid successfully")
else:
print("Transaction Failed")
elif ab2==3:
if myrecord1[4]=="Paid":
print("The fee of this quarter is already paid")
elif myrecord1[4]=="Not Paid":
ab3=int(input("Press 1 to pay tuition fee:"))
print()
if ab3==1:
query2="update payment set Quarter3='Paid' where admn_no="+ab1
cur.execute(query2)
con.commit()
print("Quarter3 fee paid successfully")
else:
print("Transaction Failed")
elif ab2==4:
if myrecord1[5]=="Paid":
print("The fee of this quarter is already paid")
elif myrecord1[5]=="10/01/2021":
ab3=int(input("Press 1 to pay tuition fee:"))
print()
if ab3==1:
query2="update payment set Quarter4='Paid' where admn_no="+ab1
cur.execute(query2)
con.commit()
print("Quarter4 fee paid successfully")
else:
print("Transaction Failed")
else:
print("Entered Admission no. doesn't exist")
print("\t\t\t *****************")
print()
except:
print("Error in retrieving payment details")
elif g1==4:
try:
j1=input("Enter Admission no. of the student who want to take TC:")
print()
query="select * from details where admn_no= "+j1
cur.execute(query)
myrecord=cur.fetchone()
c=cur.rowcount
if c>0:
j2=input("Enter name of the student for confirmation:")
print()
if myrecord[1].lower()==j2.lower():
if myrecord[6]=="Applied for TC":
print("Already applied for TC")
else:
print("Successfully applied for TC")
query1="update details set note='Applied for TC' where admn_no="+j1
cur.execute(query1)
con.commit()
else:
print("\t\t #### Confirmation Error #####")
else:
print("Entered Admission no. doesn't exist")
print("\t\t\t *****************")
print()
except:
print("Error in applying for TC")
elif g1==5:
print("\t\t\t *****************")
break
else:
print("Enter a valid command")
print("\t\t\t *****************")
elif a1==3:
k1=input("Enter Password:")
print()
while k1==p2:
print("1. Fees Payment Record")
print("2. Back to main menu")
print()
l1=int(input("Enter Required Command:"))
print()
if l1==1:
try:
query="select * from payment"
cur.execute(query)
rec=cur.fetchall()
print(tabulate(rec,headers=["Admn
No","Name","Quarter1","Quarter2","Quarter3","Quarter4"],tablefmt="fancy_grid",colalign=("left",)))
print()
print("\t\t\t *****************")
except:
print("Error in retrieving payment details")
elif l1==2:
print("\t\t\t *****************")
break
else:
print("Enter a valid command")
print("\t\t\t *****************")
break
else:
print("Enter a valid password")
print("\t\t\t *****************")
elif a1==4:
time.sleep(2)
print("\t\t\tProgram Terminating !!")
print("\t\t\t *****************")
break
else:
print("Enter a valid command")
print("\t\t\t *****************")

---------------------------------- X --------------------------- X ------------------------------


OUTPUTS
INITIAL SCREEN

1] ADMIN MENU
A) ADD NEW RECORD
*Table before Addition of New Data

i) Senior Secondary Student


ii) Secondary Student (Class 10)

iii) Secondary Student (Class 8)


*Table after addition of New Data

B) EDIT EXISTING RECORD


i) Details of Student
*Table before Editing Data

*Table before Editing Stream

1) Editing Class of Student


2) Editing Section of Student

3) Editing Attendance of Student


4) Editing Stream of Senior Secondary

Student

*Table after editing Data

*Table after editing Stream

ii) Academics of Student


*Table Before Editing Marks

*Table After Editing Marks

C) SEARCH RECORD

D) DISPLAY RECORD (Non Academic)


i) Sort by – Admission Number
ii) Sort by – Class

E) DELETE RECORD

*Search Result Before Deleting Record


*Search Result After Deleting Record
*Academic Table Before Deleting Record

*Academic Table After Deleting Record

2] USER MENU
A) STUDENT DETAILS

B) ACADEMICS
C) PAY FEES
i) If the fees is not paid:

*Payment Table Before Payment of


Fees
.

*Payment Table After Payment of Fees


ii) If the fees is already paid:

D) APPLY FOR TC
i) If Name is Incorrect

ii) If Name is Correct


*Table before Applying TC

*Table After Applying TC

3] ACCOUNTANT MENU
A) FEES PAYMENT RECORD

4] EXIT MENU

BIBLIOGRAPHY
COMPUTER SCIENCE WITH
PYTHON BY:–
SUMITA ARORA

WEBSITES:-
 www.icbse.com
 www. w3resource.com/python

THANK YOU !!!

You might also like