Computer Project

You might also like

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

1

THE INDIAN SCHOOL, BAHRAIN


DEPARTMENT OF COMPUTER SCIENCE

SCHOOL MANAGEMENT

Submitted______________________________________________________
__:By
Name: Aayushi Jogi
Roll No.:
1
Subject: Computer
Science (083)

1
2

INDEX
1. Certificate…………………………3

2. Acknowledgement……………….4

3. Introduction………………………5

4. Database Design…………………7

5. Source Code……………………..13

6. Output…………………………….34

7. Bibliography……………………..31

2
3

CERTIFICATE
This is to certify that Aayushi Jogi of 12 N
has successfully completed the computer
science project as a part of computer science
practical on the topic school management
my SQL for the academic year 2021 to 2022
as per the requirements of CBSE
examination

__________ __________
Signature of Examiner Signature of Subject Teacher

3
4

ACKNOWLEDGEMENT
I would like to express my gratitude to my
teacher, Mrs. Jyothi Abhilash, for giving me an
opportunity to do the project and for the support
and guidance which help me complete the
project on time. I also owe my profound
gratitude to all my teammates whose advice and
suggestions made this project a success.

4
5

Python features
Python provides many useful features which make it popular and
valuable from the other programming languages it supports object-
oriented programming procedural programming approaches and
provides dynamic memory allocation we have listed below a few
essential features.
1. Easy to learn and use
Python is easy to learn as compared to other programming
languages its syntax is straightforward and much the same as
English language there is no use of; Or curly bracket the
indentation defines the code block it is the recommended
programming language for beginners
2. Expressive language
Python can perform complex tasks using a few lines of code.
A simple example the hello world program you simply type
(“hello world”).It will take only one line to execute while Java or
C takes multiple lines.
3. Interpreted language
Python is an interpreted language; It means the Python program
is executed one line at a time the advantage of being interpreted
language, it makes debugging easy and portable.
4. Cross Platform language.
Python can run equally on different platforms such as Windows,
Linux, Unix, and Macintosh, etc. So we can say that Python is a
portable language. It enables programmers to develop the
software for several competing platforms by writing a program
only once.
5. Free and Open Source
Python is freely available for everyone. It is freely available on its
official website, www.python.org. It has a large community across
the world that is dedicatedly, working towards making new
Python modules and functions. Anyone can contribute to the

5
6

Python community. The open-source means, “Anyone can


download its source code without paying any penny”.
6. Object-Oriented Language.
Python supports object-oriented language and concepts of
classes and objects come into existence. It supports inheritance,
polymorphism, and encapsulation, etc. The object-oriented
procedure helps to programmer to write reusable code and
develop applications in less code.
7. Extensible
It implies that other languages such as C/C++ can be used to
compile the code and thus it can be used further in a Python
code. It converts the program into bytecode and Any. platform
can use that byte code.
8. Large Standard Library
It provides a vast range of libraries for various fields such as
machine learning, web developer, and also for the scripting.
There are various machine learning libraries, such as Tensor
flow, Pandas, Numpy, Keras, and Pytorch, etc. Django, flask,
pyramids are the popular framework for Python web
development.
9. GUI programming support
Graphical User Interface is used for the developing desktop
application. PyQT5, Tkinter, Kivy are the libraries which are
used for developing the web application.
10. Integrated
It can be easily integrated with languages like C, C++, and Java,
etc. Python runs code line by line like C, C++, Java. It makes
easy to debug the code.
11. Embeddable.
The code of the other programming language can use in Python
source code. We can use Python source code in another
programming language as well. It can embed other language into
our code.
12. Dynamic Memory Allocation

6
7

In Python, we don't need to specify the data type of the variable.


When we assign some value to the variable, it automatically
allocates the memory to the variable at run time. Suppose we are
assigned integer value 15 to x, then we don't need to write in x =
15. Just write x = 15.

7
8

DATABASE DESIGN

8
9

TABLES
1. Student_details

2. Fees

9
10

3. Student_fees_details

PROJECT SYNOPSIS
Title: School Management System
10
11

Objective: To develop a system/software that manages the


complete administration of an International School from
Kindergarten to Grade 12.

Introduction: The School Management System Project is based on


the essential features of Python and MySql. The project convolutes
the relative case of the use of Python Programming with the RDBMS
structure of MySql tables.

The program is mainly used by the School admins that manage the
student admittance, Transfer Certificates (TC), Results, and
Payment of Fees (billing).

Description: The front end of the project is developed by using


Python programming and strictly adheres to the syllabus content of
CBSE class 11th and 12th. Back end of the project is based on
MySql.

System Analysis:

With the help of well-designed functionism the administrator can


manage tasks related to the admission of students, Transfer
Certificates, Leave and Billings.

The program starts with a Main Menu from which other menus;
related to Admission, Report, TC, Billing; select by:

1. Class, 2. By Section, 3. By Name, 4. Date Of Birth, 5. By


Gender, 6. By Fee Month.

The database has 2 main divisions, i.e., tables related to students


studying in the university, and tables related to the staff
working in the university.

System Design: Flow chart, and Tables with suitable


divisions of the menus and sub menus.

11
12

Conclusion and Acknowledgements: This is to


acknowledge that this project is made under the guidance
12
13

of our Computer Science teacher; Mrs. Jyoti Abhilash,


and with the input of everyone’s idea present in the group.
This project is made by strictly following the portion and
rules presented by the CBSE.

Team Members:
1. Arpitha Asokan
2. Aayushi Jogi
3. Amala Shicklal

13
14

Code
import mysql.connector
from datetime import date
from tabulate import tabulate
from datetime import timedelta

con=mysql.connector.connect(host="localhost",user="root",password="Arpitha",
database="project")
if con.is_connected():
print('='*156)
print("\t\t\t\t\t\t\tFAITH INTERNATIONAL SCHOOL\t\t\t")
print('='*156)
cur=con.cursor()

l=["Class","TuiFee","BldgFee","LabFee","InfraFee","MiantFee","TransportFee","Co
mpFee","MemberFee"]
l1=["G.R.No.","Month","TuiFee","BldgFee","LabFee","InfraFee","MiantFee","Trans
portFee","TotalFee","FeeStatus","CompFee","MemberFee"]
lf=["Tuition Fee","Building Fee","Lab Fee","Infrastructure Fee","Maintainence
Fee","Transportation Fee","Computer Fee","Membership Fee","Total Fee"]

def UPtot(result):
for i in result:
totalfee=0
for j in range(2,len(i)):
if i[j]!=None and i[j]not in('y','Y','N','n') and i[j]!=i[8]:
totalfee+=i[j]
query="update student_fees_details set totalfee={} where GRNo={}".format(totalfe
e,i[0])
cur.execute(query)
con.commit()

def ShowBill(query):
cur.execute(query)
r=cur.fetchall()
print("G.R.No. of the student\t\t\t: ",r[0][0])
print("Month of the fee to be paid\t\t: ",r[0][1])
x=0

14
15

l=[]
for i in range(2,len(r[0])):
if r[0][i] not in (r[0][0],r[0][1],'y','Y','n','N') and r[0][i]!=r[0][8]:
l.append([lf[x],r[0][i]])
x+=1
l.append([lf[-1],r[0][8]])
print(tabulate(l,tablefmt="fancy_grid"))

def Xcute(Query):
cur.execute(Query)
con.commit()

def Complete(query1,y,x):
cur.execute(query1)
result=cur.fetchall()
if cur.rowcount>0:
print(tabulate(result,headers=["G.R.No.","Name","Class","Section","Contact
No.”,“Guardian","MOF","Gender","Date of
Birth"],tablefmt="grid",colalign="center",))

else:
print("The student under the ",y," ",x," is not present")
print('-'*156)
print('*'*156)

def Checker(query):
cur.execute(query)
result=cur.fetchall()
con.commit()
if cur.rowcount>0:
print(tabulate(result,headers=["G.R.No","Name","Class","Section","Contact
No","Local Guardian","Month of Admission","Gender","Date of
Birth"],tablefmt="grid",colalign="center",))
global d
d=0
else:
d=1

def Name():
print("\t\t\t BY NAME")
print()

15
16

y='name'
x=input("Enter the name of the student to be searched: ")
query="select * from student_details where name='{}'".format(x)
Complete(query,y,x)

def GRNo():
print("\t\t\t BY G.R.No.")
print()
y="G.R.No."
x=input("Enter the G.R.No. of the student to be searched: ")
query="select * from student_details where GRNo={}".format(x)
Complete(query,y,x)

def Class():
print("\t\t\t BY CLASS")
print()
y="class"
x=input("Enter the class of the student to be searched: ")
query="select * from student_details where class='{}'".format(x)
Complete(query,y,x)

def DOB():
print("\t\t\t BY DATE OF BIRTH")
print()
y="date of birth"
x=input("Enter the date of birth of the student to be searched (yyyy-mm-dd): ")
query="select * from student_details where DOB='{}'".format(x)
Complete(query,y,x)

def Gender():
print("\t\t\t BY GENDER")
print()
y="gender"
x=input("Enter the gender of students to be searched (Male-M/Female-F): ")
query="select * from student_details where gender='{}'".format(x)
Complete(query,y,x)

16
17

def FeeMonth():
print("\t\t\t BY FEE MONTH")
print()
print("You can check the fees of students by:-\t\t 1.Fee status of all
students in the certain fee month \n\t\t\t\t\t\t 2.Those who have
unpaid fee status \n\t\t\t\t\t\t 3.Those who paid the fees \n\t\t\t\
t\t\t 4.To search the fee details of a certain student")
s=int(input("Enter your choice: "))
if s==1:
month=input("Enter the month to be written: ")
query="select * from student_fees_details where month='{}'".format(month)
y="month"
Completed(query,y)
if s==2:
y="unpaid status"
query="select * from student_fees_details where FeeStatus='{}'".format('n')
Completed(query,y)
if s==3:
y="paid status"
query="select * from student_fees_details where FeeStatus='{}'".format('y')
Completed(query,y)
if s==4:
y=int(input("Enter the student's G.R.No. to be searched: "))
query="select * from student_fees_details where GRNo={}".format(y)
Completed(query,y)

def Admission():
print("\t\t\t Add new students and details")
print()
G=int(input("Enter the G.R.No. of the student to be added \t\t : "))
N=input("Enter the Name of the student to be added \t\t : ")
C=input("Enter the Class of the student to be added \t\t : ")
S=input("Enter the Section of the student to be added \t\t : ")
Co=int(input("Enter the Contact No. of the student to be added \t : "))
Ge=input("Enter the Gender(Male-M/Female-F) of the student to be added
: ")
print()
print("DATE OF BIRTH")

17
18

dd=int(input("Enter the date of the day \t\t\t\t : "))


mm=int(input("Enter the date of the month \t\t\t\t : "))
yy=int(input("Enter the date of the year \t\t\t\t : "))
print()
L=input("Enter the local guardian's name \t\t\t : ")
M=input("Enter the month of admission \t\t\t\t : ")
query="insert into student_details values('{}','{}','{}','{}','{}','{}','{}','{}','{}')".format(
G,N,C,S,Co,L,M,Ge,date(yy,mm,dd))
Xcute(query)
query="select * from student_details where GRNo={}".format(G)
x=y=''
Complete(query,x,y)

d=0
def Update_sd():
print("\t\t\tUPDATE STUDENT'S DETAILS")
print()
print("Your options to update student details are :- \t 1. G.R.No.
\n\t\t\t\t\t\t 2. Name \n\t\t\t\t\t\t 3. Class \n\t\t\t\t\t\t 4.
Section \n\t\t\t\t\t\t 5. Contact No. \n\t\t\t\t\t\t 6. Local
Guardian \n\t\t\t\t\t\t 7. Month of Admission \n\t\t\t\t\t\t 8.
Gender \n\t\t\t\t\t\t 9. Date of Birth")
print()
a=int(input("Enter the student detail no. to be changed: "))

#G.R.No.
if a==1:
u=input("Enter the student's name of the student whose details should
be changed: ")
query="select * from student_details where name='{}'".format(u)
Checker(query)
y=x=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set GRNo={} where Name='{}'".format(y,u)
Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
18
19

else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Name
if a==2:
u=input("Enter the student's GR.No. of the student whose details should
be changed: ")
query="select * from student_details where GRNo={}".format(u)
Checker(query)
x=y=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set Name='{}' where GRNo={}".format(y,u)
Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Class
if a==3:
u=input("Enter the student's G.R.No. of the student whose details should
be changed: ")
query="select * from student_details where GRNo={}".format(u)
Checker(query)
x=y=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set Class='{}' where GRNo={}".format(y,u)
Xcute(query)
print("Update is successful")

19
20

else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Section
if a==4:
u=input("Enter the student's G.R.No. of the student whose details should
be changed: ")
query="select * from student_details where GRNo={}".format(u)
Checker(query)
x=y=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set Section='{}' where GRNo={}".format(y,u)
Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Contact No.
if a==5:
u=input("Enter the student's G.R.No. of the student whose details should
be changed: ")
query="select * from student_details where GRNo={}".format(u)
Checker(query)
x=y=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set ContactNumber={} where
GRNo={}".format(y,u)
20
21

Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Local Guardian
if a==6:
u=input("Enter the student's G.R.No. of the student whose details should
be changed: ")
query="select * from student_details where GRNo={}".format(u)
Checker(query)
x=y=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set LocalGuardian='{}' where
GRNo={}".format(y,u)
Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Month of Admission
if a==7:
u=input("Enter the student's G.R.No. of the student whose details
should be changed: ")
query="select * from student_details where GRNo={}".format(u)
Checker(query)
x=y=''
if d==0:

21
22

c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set DateofAdmission='{}' where
GRNo={}".format(y,u)
Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Gender
if a==8:
u=input("Enter the student's G.R.No. of the student whose details
should be changed: ")
query="select * from student_details where GRNo={}".format(u)
Checker(query)
x=y=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set Gender='{}' where GRNo={}".format(y,u)
Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

#Date of Birth
if a==9:
u=input("Enter the student's G.R.No. of the student whose details
should be changed: ")
query="select * from student_details where GRNo={}".format(u)

22
23

Checker(query)
x=y=''
if d==0:
c=input("Are you sure you want to change this student's details: ")
if c=='y' or c=='Y':
y=input("Enter the new data to be replaced with: ")
query="update student_details set DOB='{}' where GRNo={}".format(y,u)
Xcute(query)
print("Update is successful")
else:
print("Updation cancelled")
else:
print("The certain student is not present or incorrect information is input")
query="select * from student_details"
Complete(query,x,y)

def Fee(l,l1):
#This is the Fees Menu
print("\t\t\tFEE")
print()
print("Your choices in fee department are:- \t 1. Display fee details of a
certain student \n\t\t\t\t\t 2. Display all fee details of students \n\t\t\t\t\t 3.
Add a certain fee type \n\t\t\t\t\t 4. Update Fee Status \n\t\t\t\t\t 5. Delete
Fees \n\t\t\t\t\t 6. Add fee details of each student \n\t\t\t\t\t 7. To update the
fees of a certain student (correction)")
ch=int(input("Enter your choice: "))
print()
cur = con.cursor()
print('-'*156)
query="select * from fees"
cur.execute(query)
row = cur.fetchall()
print(tabulate(row,headers= l,tablefmt="grid"))
con.commit()
if ch==1:
print("\t\t\t Fee of a certain student")
print()
DisplayFees(l)
if ch==2:
print("\t\t\t Fee Details of Students")

23
24

print()
DisplayFeest(l1)
if ch==3:
print("\t\t\t To add a certain fee types")
print()
AddFees(l,l1)
if ch==4:
print("\t\t\t To update fee status of students")
print()
UpdateFeeStatus(l1)
if ch==5:
print("\t\t\t To Delete fee details")
print()
DeleteFees(l1)
if ch==6:
print("\t\t\t To add fee details of a student")
print()
AddFeeDetails(l,l1)
if ch==7:
UpdateFees(l1)

def DeleteFees(l1):
cur=con.cursor()
monthunpaid=input("Month onward fee is unpaid: ")
query="select * from student_fees_details"
cur.execute(query)
result=cur.fetchall()
if cur.rowcount>0:
x=input("Are you sure you want to delete the data of these certain
students (y/Y or N/n): ")
if x=='y' or x=='Y':
query="delete from student_fees_details where feestatus='n' and
Month='{}'".format(monthunpaid)
Xcute(query)
print("Fee details of these students are deleted")
else:
print("Fee details of these students are not deleted")
else:
print("All students under ",monthunpaid," have paid the fees")
print('-'*156)

24
25

print('*'*156)
def DisplayFees(l):
cur = con.cursor()
G=int(input("Enter the G.R.No. of the Student: "))
query="select * from student_fees_details where GRNo={}".format(G)
cur.execute(query)
result=cur.fetchall()
print(tabulate(result,headers=l1,tablefmt="grid"))
print('-'*156)
print('*'*156)

def DisplayFeest(l1):
cur = con.cursor()
query="select * from student_fees_details"
cur.execute(query)
row = cur.fetchall()
print(tabulate(row,headers=l1,tablefmt="grid"))
print('-'*156)
print('*'*156)

def AddFees(l,l1):
cur=con.cursor()
w=input("Enter new column name to be entered: ")
x=input("Enter the full form of fees inputted: ")
lf.insert(-2,x)
query="alter table fees add {} int".format(w)
Xcute(query)
n=int(input("Enter the value of fees to be paid: "))
a=input("Should each class pay the same fee(y/Y or n/N): ")
if a=="y" or a=="Y":
query="update fees set {}={}".format(w,n)
Xcute(query)
else:
query="alter table student_fees_details add {} int".format(w)
Xcute(query)
L=['LKG','UKG','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII']
for i in range(len(L)):
print(L[i])
z=int(input("Enter the fees for the certain class: "))
query="update fees set '{}'={} where class={}".format(w,z,L[i])

25
26

cur.execute(query)
con.commit()
query="select * from fees"
cur.execute(query)
row=cur.fetchall()
con.commit()
query="select * from student_fees_details"
cur.execute(query)
result=cur.fetchall()
con.commit()
#global l
l.append(w)
#global l1
l1.append(w)
print(tabulate(row,headers=l,tablefmt="grid"))
print('-'*156)
print('*'*156)

def UpdateFees(l1):
cur=con.cursor()
C=input("Enter the Column whose data needs to be changed: ")
c=input("Are you sure you want to change the student's fee values(y/Y or
n/N): ")
if c=='y' or c=='Y':
g=input("Do you want to give individual fees to each class(y/Y or n/N): ")
if g=='y' or g=='Y':
L=['LKG','UKG','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII']
for i in range(len(L)):
print(L[i])
z=int(input("Enter the fees for the certain class: "))
query="update fees set '{}'={} where class={}".format(C,z,L[i])
cur.execute(query)
con.commit()
else:
amount=int(input("Enter the amount to be paid: "))
query="update fees set {}={}".format(C,amount)
Xcute(query)
z=input("Do you want to change the previous fee details of students(y/Y or
n/N): ")
if z=='y' or z=='Y':

26
27

query="update student_fees_details set {}={}".format(C,amount)


cur.execute(query)
con.commit()
query="select * from student_fees_details"
cur.execute(query)
result=cur.fetchall()
UPtot(result)
query="select * from student_fees_details"
cur.execute(query)
result=cur.fetchall()
print(tabulate(result,headers=l1,tablefmt="grid"))
query="select * from fees"
cur.execute(query)
result=cur.fetchall()
print(tabulate(result,headers=l,tablefmt="grid"))
print("The fee is successfully updated")
else:
print("The fee is not updated")
print('-'*156)
print('*'*156)

def AddFeeDetails(l,l1):
cur=con.cursor()
G=int(input("Enter the student's G.R.No. to be added: "))
M=input("Enter the month in which fees is to be paid: ")
query="select * from student_details where GRNo={}".format(G)
cur.execute(query)
result=cur.fetchall()
con.commit()
query="select * from student_fees_details where GRNo={} and Month='{}'".format(G,M)
cur.execute(query)
re=cur.fetchall()
con.commit()
#print(re)
if re==[]:
query="insert into student_fees_details (GRNo,Month) values({},'{}')".format(G,M)
cur.execute(query)
con.commit()
query="select * from fees where Class='{}'".format(result[0][2])
cur.execute(query)

27
28

row=cur.fetchall()
con.commit()
x=1
t=0
for i in range(1,len(row[0])):
query="update student_fees_details set {}={} where GRNo={} and
Month='{}'".format(l[x],row[0][i],G,M)
cur.execute(query)
con.commit()
t+=row[0][i]
x+=1
query="update student_fees_details set totalFee={} where GRNo={} and
Month='{}'".format(t,G,M)
cur.execute(query)
con.commit()
s=input("Enter the fee status of the student: " )
query="update student_fees_details set FeeStatus='{}' where GRNo={} and
Month='{}'".format(s,G,M)
cur.execute(query)
con.commit()
else:
print("The details of the student is already added in the fees table")
query="select * from student_fees_details where GRNo={} and Month='{}'".format(G,M)
cur.execute(query)
row=cur.fetchall()
con.commit()
print(tabulate(row,headers=l1,tablefmt="grid"))
if 'y' in row[0]:
ShowBill(query)
print('-'*156)
print('*'*156)

def UpdateFeeStatus(l1):
G=int(input("Enter the G.R.No.: "))
M=input("Enter the month to be paid: ")
query="select * from student_fees_details where GRNo={} and Month='{}'".format(G,M)
cur.execute(query)
row=cur.fetchall()
if cur.rowcount>0:
print(tabulate(row,headers=l1,tablefmt="grid"))

28
29

amtp=int(input("Enter the fee amount paid for the student: "))


if amtp==row[0][8] and row[0][9]=='n':
query="update student_fees_details set Feestatus='y' where GRNo={}
and month='{}'".format(G,M)
cur.execute(query)
con.commit()
query="select * from student_fees_details where GRNo={} and
month='{}'".format(G,M)
cur.execute(query)
result=cur.fetchall()
con.commit()
ShowBill(query)
print("The fee status is successfully updated")
elif row[0][9]=='y':
print("The Fees is Already Paid")
else:
print("This student does not exist in the fee table")
print('-'*156)
print('*'*156)

def TC():
print("\t\t\tT.C")
print()
print("Your options for T.C are:- 1. Delete student by name \n\t\t\t 2.
Delete student by GR.No \n\t\t\t 3. Delete student by fee month")
ch=int(input("Enter your choice: "))
if ch==1:
DeleteStudentname()
elif ch==2:
DeleteStudentGRNo()
elif ch==3:
TCbymonth()

def DeleteStudentname():
cur=con.cursor()
Name=input("Enter student name: ")
query="select * from student_details where name='{}'".format(Name)
cur.execute(query)
result=cur.fetchall()
if cur.rowcount>0:

29
30

print(tabulate(result,headers=["G.R.No","Name","Class","Section","Contact
No","Local Guardian","Month of Admission","Gender","Date of
Birth"],tablefmt="grid",colalign="center",))
ch=input("Enter do you want to Delete (y/Y): ")
if ch=='y' or ch=='Y':
query="Delete from student_details where name='{}'".format(Name)
Xcute(query)
Query="delete from student_fees_details where GRNo={}".format(result[0][0])
Xcute(Query)
print("Record has been successfully deleted")
else:
print("Record is not deleted")
else:
print("Record is not present")
print("-"*156)
print("*"*156)

def DeleteStudentGRNo():
GRNo=input("Enter student GR.No.: ")
query="select * from student_details where GRNo='{}'".format(GRNo)
cur.execute(query)
result=cur.fetchall()
if cur.rowcount>0:
print(tabulate(result,headers=["G.R.No","Name","Class","Section","Contact
No","Local Guardian","Month of Admission","Gender","Date of
Birth"],tablefmt="grid",colalign="center",))
ch=input("Enter do you want to Delete (y/Y): ")
if ch=='y' or ch=='Y':
query="Delete from student_details where GRNo={}".format(GRNo)
cur.execute(query)
con.commit()
Query="delete from student_fees_details where GRNo={}".format(result[0][0])
cur.execute(Query)
con.commit()
print("Record has been successfully deleted")
else:
print("Record is not deleted")
else:
print("Record is not present")
print("-"*156)

30
31

print("*"*156)

def TCbymonth():
monthunpaid=input("month onward fee is unpaid: ")
query="select * from student_fees_details where Month='{}' and
FeeStatus='n'".format(monthunpaid)
cur.execute(query)
result=cur.fetchall()
if cur.rowcount>0:
print(tabulate(result,headers=l1,tablefmt="grid",colalign="center",))
x=input("Are you sure you want to delete the data of these certain
students (y/Y or N/n) :")
if x=='y' or x=='Y':
for i in range(len(result)):
query="delete from student_fees_details where feestatus='n' and
GRNo={}".format(result[i][0])
Xcute(query)
Query="delete from student_details where GRNo={}".format(result[i][0])
Xcute(query)
print("Record is successfully deleted")
else:
print("Record is not deleted")
else:
print("Record is not present")
print("-"*156)
print("*"*156)
#the main menu
while True:
print()
print("\t\t\t\t\tMAIN MENU")
print()
print("\t\t\t1. ADMISSION \n\t\t\t2. SEARCH \n\t\t\t3. REPORT
\n\t\t\t4. T.C \n\t\t\t5. FEE \n\t\t\t6. END OF CODE")
print()
x=int(input("Enter your choice no.: "))
print('*'*156)
if x==1:
print("\t\t\tADMISSION")
print()
print("Your choices for admission and details are:- \t1. Add new students
and details\n\t\t\t\t\t\t2. To change a particular student's details")
31
32

print()
c=int(input("Enter your choice no.: "))
print('-'*156)
if c==1:
Admission()
if c==2:
Update_sd()
if x==2:
#search menu
print("\t\t\tSEARCH")
print()
print("Your choices to select students are:- \t1. By Name\n\t\t\t\t\t2.
By G.R.No.")

print()
c=int(input("Enter your choice no.: "))
print('-'*156)
if c==1:
Name()
if c==2:
GRNo()
if x==3:
print("\t\t\tREPORT")
print()
print("Your choices to select students in group are:- \t1. By Class
\n\t\t\t\t\t\t2. By Date of Birth \n\t\t\t\t\t\t3. By Gender \n\t\t\t\t\
t\t4. By Fee Month")
c=int(input("Enter your choice no.: "))
print('-'*156)
if c==1:
Class()
if c==2:
DOB()
if c==3:
Gender()
if c==4:
FeeMonth()
if x==4:
TC()

32
33

if x==5:
Fee(l,l1)
if x==6:
break
print('\t\t\t\t\t\t\t\tTHE END')
print('='*156)
print('_'*156)

33
34

Screen Shots
of the code’s
output:

34
35

35
36

36
37

37
38

38
39

39
40

40
41

41
42

42
43

BIBLIOGRAPHY:
https://www.javatpoint.com/python-features
https://www.python.org/doc/essays/blurb/
https://www.geeksforgeeks.org/python-language-introduction/
#:~:text=Python%20is%20a%20widely%20used,in%20fewer
%20lines%20of%20code.

43

You might also like