0% found this document useful (0 votes)
53 views34 pages

Result Analysis of A Student

Uploaded by

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

Result Analysis of A Student

Uploaded by

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

Vandana International School

Academic Session:2024-25

Project Report
on
“Result Analysis of a student System”
(For AISSCE 2024-25 Examination)

Submitted by- Project Guide -


Roll No: Ms. Madhu Sehgal
Name: PGT(Computer Science)
Class: XII
Subject: Computer Science
Subject Code: 083
Certificate
This is to certify that ___________of Class XII, Vandana
International School, has successfully developed his/her
Computer Science Project titled “Result Analysis of a student
System”, under my supervision. The work done by him/her is
original and is submitted for the AISSCE(Session 2024-25) as
prescribed by CBSE.

Signature of Signature of
Internal Examiner External Examiner
ACKNOWLEDGEMENT

Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of this
project. I express deep sense of gratitude to almighty God for giving me strength for
the successful completion of the project. I am greatly indebted to Ms Madhu Sehgal,
Teacher in Computer Science who gave me immense support and guidance
throughout the completion of this project.

I express my heartfelt gratitude to my parents for constant encouragement while


carrying out this project. I gratefully acknowledge the contribution of the individuals
who contributed in bringing this project up to this level, who continues to look after me
despite my flaws, The guidance and support received from all the members who
contributed and who are contributing to this project, was vital for the success of the
project. I am grateful for their constant support and help.
Index
S. No. Title Page Nos.

1. Introduction to the Project


06

2. Objective & Scope of the Project


07

3. Hardware and Software Requirements


08

4. Modules and Functions used


09-10

5. Database and Tables used


11

6. Coding
12-27

7. Output Screens
28-32

8. User Manual
33-34

9. Bibliography
35

5|Page
Introduction to the Project
In the contemporary educational landscape, the efficient
assessment and evaluation of students' academic
performance are critical aspects that influence educational
outcomes. As educational institutions strive to enhance the
quality of learning experiences, there is an increasing need
for systematic tools and methodologies to evaluate students'
progress. This project aims to address this need by
developing a Python-based system for the evaluation of
students' academic performance.

Traditional methods of student evaluation often involve


manual processes, making it time-consuming and prone to
errors. With advancements in technology, there is an
opportunity to leverage programming and computational
tools to streamline the assessment process. This project
focuses on creating a robust and user-friendly system that
facilitates the recording and analysis of students' grades
across various subjects.

6|Page
Objective & Scope of the Project
The primary objectives of this project include:

 Automated Evaluation: Develop a system that allows


educators to input students' grades for different subjects,
automating the calculation of overall performance metrics.

 Data Representation: Implement a structured


representation of student data, enabling easy retrieval and
analysis of individual and collective academic performance.

 User-Friendly Interface: Design an intuitive user


interface that ensures accessibility for educators and
administrators, promoting ease of use and adoption.

Scope of the project:

This project is designed to address the immediate needs of


educational institutions by providing a streamlined and
automated approach to evaluating students' academic
performance. The scope of the project includes the development
of a Python-based console application that focuses on the core
features of student data management and performance
assessment.

7|Page
Hardware and Software
Requirements

Hardware Requirements :

∗ Processor : Intel Core i3


∗ RAM : 512 MB
∗ Hard disk : 500 GB or above
(Write the one you have)
∗ CD/DVD/Pen-drive : (Write any 1 of these for backup)
∗ Printer : Laserjet or Inkjet
(Write any 1 of these)

Software Requirements :

∗ Windows 10
∗ Python 3.9
∗ MySQL 5.0
∗ Microsoft Word 2019

8|Page
Modules and Functions Used
Following modules are used in this project:

 Mysql
The MySQL module typically refers to a programming library or module that
facilitates interaction with a MySQL database from within a programming language.
prettytable
The PrettyTable module in Python is a lightweight and easy-to-use library for creating
and displaying ASCII tables. It simplifies the process of formatting and presenting
tabular data in a visually appealing way within the console or terminal.

Following functions are used in this project:

result_M2(x) – here x is the roll no. of the student and it


returns the result (in tabular form) for classes 1-10.
result_MS(x) - here x is the roll no. of the student and it
returns the result (in tabular form) for science stream of both
class 11 and 12.
 result_MC(x) - here x is the roll no. of the student and it
returns the result (in tabular form) for commerce stream of
both class 11 and 12.

9|Page
 result_MH(x) - here x is the roll no. of the student and it
returns the result (in tabular form) for Humanities stream of
both class 11 and 12.
len() - is a versatile tool for obtaining the length or size of
various objects in Python such as strings, lists, tuples, and
other iterable objects.
 print() - provides flexibility for displaying information
during development, debugging, and user interaction.

10 | P a g e
Database and Tables Used
Database used in this project:

 myschool

Tables used in this project:

 Main
 M2
 Ms
 Mh
 Mc

11 | P a g e
Coding
from prettytable import PrettyTable
import mysql.connector
p=mysql.connector.connect(host="localhost",user="root",passwd="root")
q=p.cursor()
q.execute("create database if not exists myschool")
p=mysql.connector.connect(host="localhost",user="root",passwd="root",database="myschool")
q=p.cursor()
q.execute('''create table if not exists main(SID bigint(225) primary key,Name varchar(45),Class int(2),
M1_ID bigint (225) ,SM_ID bigint (225) ,
CM_ID bigint(225) ,HM_ID bigint (225) )''')
q.execute('''create table if not exists m2(M1_ID bigint(225) primary key,Class int(2),Hindi int(3),SST
int(3),
Maths int(3),Eng int(3),Science int(3),Skt int(3),French int(3),Per int)''')
q.execute('''create table if not exists ms(SM_ID bigint(225) primary key,Class int(2),Chem int(3),
Phy int(3),Maths int(3),CS int(3),Bio int(3),PE int(3),Eng int(3),Per int)''')
q.execute('''create table if not exists mc(CM_ID bigint(225) primary key,Class int(2),Bst int(3),
Accounts int(3),Maths int(3),Economics int(3),PE int(3),IP int(3),Eng int(3),Per int)''')
q.execute('''create table if not exists mh(HM_ID bigint(225) primary key,Class int(2),History int(3),
Pol_Sc int(3),Sociology int(3),Geography int(3),PE int(3),Eng int(3),Per int)''')

global pyt
pyt="abc"
global uyt
uyt="doris"

def result_M2(x):
q=p.cursor()
q.execute('''SELECT MAIN.SID,MAIN.NAME,
MAIN.CLASS,m2.Hindi,m2.MATHS,m2.SST,m2.SCIENCE,m2.ENG,m2.SKT,m2.FRENCH,M2.PER
FROM MAIN,m2 WHERE MAIN.M1_ID=M2.M1_ID and MAIN.M1_ID=%s''',(x,))
k=q.fetchall()
t= PrettyTable()
t.field_names =
['SID','NAME','CLASS','HINDI','SST','MATHS','ENG','SCIENCE','SKT','FRENCH','PER']
for i in k:
t.add_row(list(i))
print("\n",t)

def result_MS(y):
q=p.cursor()
q.execute('''SELECT
MAIN.SID,MAIN.NAME,MAIN.CLASS,MS.CHEM,MS.PHY,MS.MATHS,MS.CS,MS.BIO,MS.PE,
MS.ENG,MS.PER
12 | P a g e
FROM MAIN,MS WHERE MAIN.SM_ID=MS.SM_ID AND MAIN.SM_ID=%s''',(y,))
k=q.fetchall()
t= PrettyTable()
t.field_names = ['SID','NAME','CLASS','CHEM','PHY','MATHS','CS','BIO','PE','ENG','PER']
for i in k:
t.add_row(list(i))
print("\n",t)

def result_MC(z):
q=p.cursor()
q.execute('''SELECT
MAIN.SID,MAIN.NAME,MAIN.CLASS,MC.BST,MC.ACCOUNTS,MC.MATHS,MC.ECONOMICS,
MC.PE,MC.IP,MC.ENG,MC.PER
FROM MAIN,MC WHERE MAIN.CM_ID=MC.CM_ID AND MAIN.CM_ID=%s''',(z,))
k=q.fetchall()
t= PrettyTable()
t.field_names =
['SID','NAME','CLASS','BST','ACCOUNTS','MATHS','ECO','PE','IP','ENG','PER']

for i in k:
t.add_row(list(i))
print(t)

def result_MH(r):
q=p.cursor()
q.execute('''SELECT
MAIN.SID,MAIN.NAME,MAIN.CLASS,MH.HISTORY,MH.POL_SC,MH.SOCIO,MH.GEO,MH.PE
,MH.ENG,MH.PER
FROM MAIN,MH WHERE MAIN.HM_ID=MH.HM_ID AND MAIN.HM_ID=%s''',(r,))
k=q.fetchall()
t= PrettyTable()
t.field_names = ['SID','NAME','CLASS','HISTORY','POL_SC','SOCIO','GEO','PE','ENG','PER']

for i in k:
t.add_row(list(i))
print(t)

print("--------------------------WELCOME -------------------------")
while True:
print("\1.Admin\n2.User\n3.Escape")
ch=int(input("\nEnter your choice (1/2): "))
if ch==1:
global wn
wn=input("Enter Username: ")
global pd
pd=input("Enter password: ")
if pd==pyt and wn==uyt:

13 | P a g e
while True:
print("\n\n ****************MENU******************* \n1.Add record\n2.Enter
Marks\n3.Update Marks\n4.Delete record\n5.View Result\n6.View Main table\n7.Settings\n8.Escape")
ch=int(input("\nEnter your choice (numerical value only): "))
if ch==1:
while True:
s=int(input("Enter Student Id (SID): "))
n=input("Enter Name: ")
c=int(input("Enter class: "))
if c==11 or c==12:
print("Streams Available:\n\n1.Science\n2.Commerce\n3.Humanities")
k=int(input("Enter Stream [1/2/3]"))
if k==1:
ms=int(input("Enter Roll no.: "))
q.execute("insert into
Main(SID,Name,Class,SM_ID)VALUES(%s,%s,%s,%s)",(s,n,c,ms))
p.commit()

elif k==2:
mc=int(input("Enter Roll no.: "))
q.execute("insert into
Main(SID,Name,Class,CM_ID)VALUES(%s,%s,%s,%s)",(s,n,c,mc))
p.commit()

elif k==3:
mh=int(input("Enter Roll no.: "))
q.execute("insert into
Main(SID,Name,Class,HM_ID)VALUES(%s,%s,%s,%s)",(s,n,c,mh))
p.commit()

else:
print("Please Enter a valid choice")
else:
m1=int(input("Enter Roll no.: "))
q.execute("insert into
Main(SID,Name,Class,M1_ID)VALUES(%s,%s,%s,%s)",(s,n,c,m1))
p.commit()

ch=int(input("Enter -1 to exit, any other number to insert records into student


table:"))

if(ch==-1):
break
print("\nCONGO!!!!------Insertion completed-------")

14 | P a g e
elif ch==2:
while True:
print("1.Class 1-10\n2.Class 11-12")
ch=int(input("Enter your choice (1/2): "))
if ch==1:
while True:
s=int(input("Enter Roll no.: "))
c=int(input("Enter Class (numerical value only) [1-10]: "))
if c==11 or c==12:
print("############ERROR DETECTED############")
break
else:
pass
h=int(input("Enter marks scored in Hindi: "))
st=int(input("Enter marks scored in SST: "))
m=int(input("Enter marks scored in Maths: "))
e=int(input("Enter marks scored in English: "))
sc=int(input("Enter marks scored in Science: "))
sk=int(input("Enter marks scored in Sanskrit: "))
f=int(input("Enter marks scored in French: "))
v=(h+st+m+e+sc+sk+f)/5

q.execute("insert into
m2(M1_ID,Class,Hindi,SST,Maths,Eng,Science,Skt,French,Per)VALUES(%s,%s,%s,%s,%s,%s,%s,
%s,%s,%s)",(s,c,h,st,m,e,sc,sk,f,v))
p.commit()
ch=int(input("Enter -1 to exit, any other number to insert records into student
table:"))

if(ch==-1):
break
print("\nCONGO!!!!------Insertion completed-------")
elif ch==2:
print("1.Science Stream\n2.Commerce Stream\n3.Humanities Stream")
ch=int(input("Enter your choice: "))
if ch==1:
while True:
try:
s=int(input("Enter Roll no.: "))
except:
print("this id already exists")
ch=int(input("Enter -1 to exit, any other number to insert records into student
table:"))

if(ch==-1):
break

c=int(input("Enter Class (numerical value only) [11/12]: "))

15 | P a g e
if c!=11 and c!=12:
print("############ERROR DETECTED############")
break
else:
pass
che=int(input("Enter marks scored in Chemistry: "))
phy=int(input("Enter marks scored in Physics: "))
m=int(input("Enter marks scored in Mathematics: "))
cs=int(input("Enter marks scored in Computer Science(CS): "))
b=int(input("Enter marks scored in Biology: "))
pe=int(input("Enter marks scored in Physical Education (PE): "))
e=int(input("Enter marks scored in English: "))
v=(che+phy+m+cs+b+pe+e)/5

q.execute("insert into
ms(SM_ID,Class,Chem,Phy,Maths,CS,Bio,PE,Eng,Per)VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%
s)",(s,c,che,phy,m,cs,b,pe,e,v))
p.commit()
ch=int(input("Enter -1 to exit, any other number to insert records into student
table:"))

if(ch==-1):
break
print("\nCONGO!!!!------Insertion completed-------")
elif ch==2:
while True:
s=int(input("Enter Roll no.: "))
c=int(input("Enter Class (numerical value only) [11/12]: "))
if c!=11 and c!=12:
print("############ERROR DETECTED############")
break
else:
pass
bst=int(input("Enter marks scored in Buisness studies (Bst): "))
acc=int(input("Enter marks scored in Accounts: "))
m=int(input("Enter marks scored in Mathematics: "))
eco=int(input("Enter marks scored in Economics (Eco): "))
pe=int(input("Enter marks scored in Physical Education (PE): "))
ip=int(input("Enter marks scored in Information Practices (IP): "))
e=int(input("Enter marks scored in English: "))
v=(bst+acc+m+eco+pe+ip+e)/5

q.execute("insert into
mc(CM_ID,Class,Bst,Accounts,Maths,Economics,PE,IP,Eng,Per)VALUES(%s,%s,%s,%s,%s,%s,%s,
%s,%s,%s)",(s,c,bst,acc,m,eco,pe,ip,e,v))
p.commit()
ch=int(input("Enter -1 to exit, any other number to insert records into student
table:"))

16 | P a g e
if(ch==-1):
break
print("\nCONGO!!!!------Insertion completed-------")
elif ch==3:
while True:
s=int(input("Enter Roll no.: "))
c=int(input("Enter Class (numerical value only) [11/12]: "))
if c!=11 and c!=12:
print("############ERROR DETECTED############")
break
else:
pass
his=int(input("Enter marks scored in History: "))
pol=int(input("Enter marks scored in Pol Science(Pol_Sc): "))
socio=int(input("Enter marks scored in Sociology: "))
geo=int(input("Enter marks scored in Geography: "))
pe=int(input("Enter marks scored in Physical Education (PE): "))
e=int(input("Enter marks scored in English: "))
v=(his+pol+socio+geo+pe+e)/5

q.execute("insert into
mh(HM_ID,Class,History,Pol_Sc,Sociology,Geography,PE,Eng,Per)VALUES(%s,%s,%s,%s,%s,%s,
%s,%s,%s)",(s,c,his,pol,socio,geo,pe,e,v))
p.commit()
ch=int(input("Enter -1 to exit, any other number to insert records into student
table:"))

if(ch==-1):
break
print("\nCONGO!!!!------Insertion completed-------")
else:
print("Please enter a valid choice" )
ch=int(input("\nEnter -1 if you are done entering marks, else press any other number"))
if ch==-1:
break

elif ch==3:
while True:
print("\n1.Class 1-10\n2.Class 11-12\n3.Exit")
ch=int(input("Enter your choice (1/2): "))
if ch==1:
m=int(input("Enter Roll no. of the student.: "))

print("\nSubjects:\n1.Hindi\n2.SST\n3.Maths\n4.Eng\n5.Science\n6.Skt\n7.French")
k=int(input("Enter your choice: "))
i=int(input("Enter the new marks: "))

17 | P a g e
if k==1:
try:
q.execute("UPDATE M2 SET HINDI= %s WHERE M1_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

print("updation done")
elif k==2:
try:
q.execute("UPDATE M2 SET SST= %s WHERE M1_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif k==3:
try:
q.execute("UPDATE M2 SET MATHS= %s WHERE M1_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif k==4:
try:
q.execute("UPDATE M2 SET ENG= %s WHERE M1_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif k==5:
try:
q.execute("UPDATE M2 SET SCIENCE= %s WHERE M1_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif k==6:
try:
q.execute("UPDATE M2 SET SKT= %s WHERE M1_ID =%s",(i,m))
p.commit()

18 | P a g e
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif k==7:
try:
q.execute("UPDATE M2 SET FRENCH= %s WHERE M1_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

else:
print("Please enter a valid choice")
q.execute("update m2 set
per=(m2.Hindi+m2.Eng+m2.maths+m2.SST+m2.Science+m2.Skt+m2.French)/5")
p.commit()

elif ch==2:
print("Streams Available:\n\n1.Science\n2.Commerce\n3.Humanities")
k=int(input("Enter Stream [1/2/3]"))
if k==1:
m=int(input("Enter Roll no. of the student.: "))
print("\nSubjects:\n1.Chem\n2.Phy\n3.Maths\n4.CS\n5.Bio\n6.PE\n7.Eng")

h=int(input("Enter your choice: "))


i=int(input("Enter the new marks: "))
if h==1:
try:
q.execute("UPDATE MS SET CHEM= %s WHERE SM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==2:
try:
q.execute("UPDATE MS SET PHY= %s WHERE SM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==3:
try:
q.execute("UPDATE MS SET MATHS= %s WHERE SM_ID =%s",(i,m))

19 | P a g e
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==4:
try:
q.execute("UPDATE MS SET CS= %s WHERE SM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==5:
try:
q.execute("UPDATE MS SET BIO= %s WHERE SM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==6:
try:
q.execute("UPDATE MS SET PE= %s WHERE SM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==7:
try:
q.execute("UPDATE MS SET ENG= %s WHERE SM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

else:
print("Please enter a valid choice")
q.execute("update ms set
per=(ms.Chem+ms.Eng+ms.Maths+ms.Phy+ms.CS+ms.PE+mS.Bio)/5")
p.commit()
elif k==2:

m=int(input("Enter Roll no. of the student.: "))

print("\nSubjects:\n1.Bst\n2.Accounts\n3.Maths\n4.Economics\n5.PE\n6.IP\n7.Eng")
h=int(input("Enter your choice: "))

20 | P a g e
i=int(input("Enter the new marks: "))
if h==1:
try:
q.execute("UPDATE MC SET BST= %s WHERE CM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==2:
try:
q.execute("UPDATE MC SET ACCOUNTS= %s WHERE CM_ID
=%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==3:
try:
q.execute("UPDATE MC SET MATHS= %s WHERE CM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==4:
try:
q.execute("UPDATE MC SET ECONOMICS= %s WHERE CM_ID
=%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

elif h==5:
try:
q.execute("UPDATE MC SET PE= %s WHERE CM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
elif h==6:
try:
q.execute("UPDATE MC SET IP= %s WHERE CM_ID =%s",(i,m))

21 | P a g e
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
elif h==7:
try:
q.execute("UPDATE MC SET ENG= %s WHERE CM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
else:
print("Please enter a valid choice")
q.execute("update mc set
per=(mc.Bst+mc.Eng+mc.Maths+mc.Accounts+mc.Economics+mc.PE+mc.IP)/5")
p.commit()

elif k==3:
m=int(input("Enter Roll no. of the student.: "))

print("\nSubjects:\n1.History\n2.Pol_Sc\n3.Sociology\n4.Geography\n5.PE\n6.Eng")

h=int(input("Enter your choice: "))


i=int(input("Enter the new marks: "))
if h==1:
try:
q.execute("UPDATE MH SET HISTORY= %s WHERE HM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
elif h==2:
try:
q.execute("UPDATE MH SET POL_SC= %s WHERE HM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
elif h==3:
try:
q.execute("UPDATE MH SET SOCIOLOGY= %s WHERE HM_ID
=%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
elif h==4:
try:

22 | P a g e
q.execute("UPDATE MH SET GEOGRAPHY= %s WHERE HM_ID
=%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
elif h==5:
try:
q.execute("UPDATE MH SET PE= %s WHERE HM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")
elif h==6:
try:
q.execute("UPDATE MH SET ENG= %s WHERE HM_ID =%s",(i,m))
p.commit()
print("Updation done")
except:
print("------------------An ERROR occured-----------------")

else:
print("Please enter a valid choice")
q.execute("update mc set
per=(mc.Bst+mc.Eng+mc.Maths+mc.Accounts+mc.Economics+mc.PE+mc.IP)/5")
p.commit()
elif ch==3:
print("\nXXX-------All updations done successfully--------XXX")
break
else:
print("Please enter a valid choice")

elif ch==4:
while True:
print("\n1.Class 1-10\n2.Class 11-12\n3.Main table\n4.Exit")
ch=int(input("Enter your choice (1/2): "))
if ch==1:
m=int(input("Enter Roll no. of the student.: "))
q.execute("DELETE FROM M2 WHERE M1_ID=%s",(m,))
p.commit()
q.execute("DELETE FROM MAIN WHERE M1_ID=%s",(m,))
p.commit()
print("-------RECORD DELETED SUCCESSFULLY--------")
elif ch==2:
print("Streams Available:\n\n1.Science\n2.Commerce\n3.Humanities")
k=int(input("Enter Stream [1/2/3]"))
if k==1:
m=int(input("Enter Roll no. of the student.: "))

23 | P a g e
q.execute("DELETE FROM MS WHERE SM_ID=%s",(m,))
p.commit()
q.execute("DELETE FROM MAIN WHERE SM_ID=%s",(m,))
p.commit()
print("-------RECORD DELETED SUCCESSFULLY--------")
elif k==2:
m=int(input("Enter Roll no. of the student.: "))
q.execute("DELETE FROM MC WHERE CM_ID=%s",(m,))
p.commit()
q.execute("DELETE FROM MAIN WHERE CM_ID=%s",(m,))
p.commit()
print("-------RECORD DELETED SUCCESSFULLY--------")
elif k==3:
m=int(input("Enter Roll no. of the student.: "))
q.execute("DELETE FROM MH WHERE HM_ID=%s",(m,))
p.commit()
q.execute("DELETE FROM MAIN WHERE HM_ID=%s",(m,))
p.commit()
print("-------RECORD DELETED SUCCESSFULLY--------")
else:
print ("Please enter a valid choice")
elif ch==3:
m=int(input("Enter Student Id: "))
q.execute("DELETE FROM MAIN WHERE SID=%s",(m,))
p.commit()
print("-------RECORD DELETED SUCCESSFULLY--------")
elif ch==4:
print("######Deletion Done successully######")
break
else:
print("Please enter a valid choice")

elif ch==5:
print("\n-------->\n Result sheet of Students of class 1-10\n")
q=p.cursor()
q.execute('''SELECT MAIN.SID,MAIN.NAME,
MAIN.CLASS,m2.Hindi,m2.MATHS,m2.SST,m2.SCIENCE,m2.ENG,m2.SKT,m2.FRENCH,M2.PER
FROM MAIN
LEFT JOIN M2 ON MAIN.M1_ID=M2.M1_ID WHERE MAIN.M1_ID != 0''')
k=q.fetchall()
t= PrettyTable()
t.field_names =
['SID','NAME','CLASS','HINDI','SST','MATHS','ENG','SCIENCE','SKT','FRENCH','PER']

for i in k:
t.add_row(list(i))
print(t)

24 | P a g e
print("\n-------->\n Result sheet of Students of class 11 and 12 (SCIENCE STREAM)\n")
q=p.cursor()
q.execute('''SELECT MAIN.SID,MAIN.NAME, MAIN.CLASS,
MS.CHEM,MS.PHY,MS.MATHS,MS.BIO,MS.CS,MS.PE,MS.ENG,MS.PER
FROM MAIN
LEFT JOIN MS ON MAIN.SM_ID=MS.SM_ID WHERE MAIN.SM_ID != 0''')
k=q.fetchall()
t= PrettyTable()
t.field_names =
['SID','NAME','CLASS','CHEM','PHY','MATHS','CS','BIO','PE','ENG','PER']

for i in k:
t.add_row(list(i))
print(t)
print("\n-------->\n Result sheet of Students of class 11 and 12 (COMMERCE
STREAM)\n")
q=p.cursor()
q.execute('''SELECT MAIN.SID,MAIN.NAME, MAIN.CLASS,

MC.BST,MC.ACCOUNTS,MC.MATHS,MC.ECONOMICS,MC.PE,MC.IP,MC.ENG,MC.PER
FROM MAIN LEFT JOIN MC ON MAIN.CM_ID=MC.CM_ID WHERE
MAIN.CM_ID !=0''')
k=q.fetchall()
t= PrettyTable()
t.field_names =
['SID','NAME','CLASS','BST','ACCOUNTS','MATHS','ECO','PE','IP','ENG','PER']

for i in k:
t.add_row(list(i))
print(t)

print("\n-------->\n Result sheet of Students of class 11 and 12 (HUMANITIES


STREAM)\n")
q.execute('''SELECT MAIN.SID,MAIN.NAME, MAIN.CLASS,

MH.HISTORY,MH.POL_SC,MH.SOCIOLOGY,MH.GEOGRAPHY,MH.PE,MH.ENG,MH.PER
FROM MAIN LEFT JOIN MH ON MAIN.HM_ID=MH.HM_ID WHERE
MAIN.HM_ID != 0''')
k=q.fetchall()
t= PrettyTable()
t.field_names =
['SID','NAME','CLASS','HISTORY','POL_SC','SOCIO','GEO','PE','ENG','PER']

for i in k:
t.add_row(list(i))
print(t)

25 | P a g e
elif ch==6:
q.execute("SELECT SID,NAME,CLASS FROM MAIN")

k=q.fetchall()
t= PrettyTable()
t.field_names = ['SID','NAME','CLASS']

for i in k:
t.add_row(list(i))
print(t)
elif ch==7:
print("\n1.Change password\n2.Edit Username")
ch=int(input("Enter your choice: "))
if ch==1:
o=input("Enter old password: ")

pyt=input("Enter new password: ")


if o==pd:
pd=pyt
print("password changed")
else:
print("old password---incorrect")
elif ch==2:
j=input("Enter old username: ")
uyt=input("Enter new username: ")
if j==wn:
wn=uyt
print("Username edited")
else:
print("old username---incorrect")

elif ch==8:
print("\n\n****************THANK YOU*******************")
break
else:
print("Please enter a valid choice")
else:
print("Invalid userid/password")
elif ch==2:
print ("1. View result of a student")
ch=int(input("Enter 1 to view result:"))
if ch==1:
while True:
w=int(input("\nEnter Class of the student(1-12): "))
if w!=11 and w!=12:

26 | P a g e
t=int(input("Enter Roll no. of the student:"))
result_M2(t)

elif w==11 or w==12:


print("1.Science\n2.Commerce\n3.Humanities")
u=int(input("Enter Stream(1/2/3): "))
if u==1:
t=int(input("Enter Roll no. of the student:"))
result_MS(t)

elif u==2:
t=int(input("Enter Roll no. of the student:"))
result_MC(t)

elif u==3:
t=int(input("Enter Roll no. of the student:"))
result_MH(t)

else:
print("Please enter a valid choice")

else:
print("Please enter a valid class")
break
ch=int(input("\nEnter -1 to exit***any other number to view result of any other Student
***:"))

if(ch==-1):
break
else:
pass
else:
print("Please enter a valid choice")

elif ch==3:
print("\n\n****************THANK YOU*******************\n\n---------------------HAVE A
NICE DAY!!!!------------------------")
break
else:
print("Please enter a valid choice")

27 | P a g e
Output Screens

28 | P a g e
29 | P a g e
30 | P a g e
31 | P a g e
32 | P a g e
User Manual

A. If the user is the admin then:

 You will have to enter your username and password in order


to proceed further.
1. Add Record:
You can add new record into the main table which includes
the details of all the students irrespective of their classes.
2. Enter Marks:
You can enter marks of the students according to their
classes. You will be provided with two options i.e. class 1-10
or class 11 and 12. Please enter the marks accordingly. The
overall percentage of the child will be calculated
automatically and will be displayed in the result sheet.
3. Update marks:
In case you wish to update the marks of any student then
you can do that by entering the class and roll no. of the
student (wherever asked).
4. Delete record:
In case you wish to delete record of any student then you can
do that by entering the class and roll no. of the student
(wherever asked).
5. View result:
You can view result of all the students collectively. For
classes 11 and 12, it will be displayed stream wise.
33 | P a g e
6. View main table:
It will display a table containing Student Id, Name and class
of all the students in the school.
7. Settings:
It allows you to change password and username required for
logging in as admin.
8. Escape:
You will escape the admin window.

B. If you are logging in as a user then you have the right to view
result of a particular child by entering the class and roll no. of the
student (wherever asked).

C. You can Escape the main window (by pressing 3)

34 | P a g e
Bibliography
Books:

 Computer Science with Python by Sumita Arora

 Computer Science with Python by Preeti Arora

 Computer Science textbook for class XII NCERT




Websites:

 https://www.w3schools.com/

 https://www.geeksforgeeks.org/python-user-defined-
functions/

 https://www.programiz.com/python-
programming/user-defined-function

35 | P a g e

You might also like