You are on page 1of 26

PRAMATI HILLVIEW ACADEMY

UDAYARAVI ROAD, KUVEMPUNAGAR, MYSURU-570023

Investigatory project on
STUDENT DETAILS & EXAM RESULT

Submitted by: Ansh appanna ky


Class: XII G
Roll.no: CBS107
PRAMATI HILLVIEW ACADEMY
UDAYARAVI ROAD, KUVEMPUNAGAR, MYSURU-570023

CERTIFICATE

This is to certify that Mr/Ms ANSH APPANNA KY of class XII has

successfully completed Computer Science project on the topic

STUDENT DETAILS & EXAM RESULT

USING MYSQL prescribed by Central Board of Secondary

Education during academic session 2023-2024.

Internal Examiner

Principal
ACKNOWLEDGEMENT

I wish to express my deep gratitude and sincere thanks to my Computer Science

teachers, Pramati Hillview Academy for her encouragement and for all the

facilities that they have provided for the completion of this project work. I take

this opportunity to express my deep sense of gratitude for her invaluable

guidance, constant encouragement, immense motivation, which has sustained my

efforts at all the stages of this project work.

I am also thankful to our Principal who has given all support to this project.

I would like to extend my gratitude to my parents for their encouragement and

support given to me.

Signature of candidate
INDEX
 Brief Overview of Project

 Need of Computerization

 Software and Hardware requirement

 Advantages of Project

 Limitations of Project

 Source Code of Project

 Output Screening

 Future Enhancement of Project

 Bibliography

BRIEF OVERVIEW
Student Details and Exam Result is developed using python. While using
this Student Details and Exam Result we can easily store student details and
marks scored in different subjects.

All you have to do is to just fill the required data like Rollno,name, …
when prompted by the computer along with different subject marks. The
program will display complete student details and his marks in different
subjects along with examination and department.

There is no error and warning content in this project. This design is so


simple that user won’t find it difficult to use and navigate

INPUT DATA AND VALIDATION OF PROJECT


 All the fields such as Student and Result details (rollno,mobileno..) are validated
and do not take invalid values.
 Each form of Student and Result cannot accept the blank values.
 Avoiding errors in data.
 Controlling amount of given data.

SOFTWARE AND HARDWARE REQUIREMENTS

Data file handling: has been effectively used in the program. The database is a
collection of interrelated data to serve multiple applications. That is database
programs create files of information. So we see that files are worked with most,
inside the program.

DBMS: The software required for the management of data is called as


MYSQL(DBMS). It has 3 models:

 Relational model
 Hierarchical model
 Network model

RELATIONAL MODEL: It’s based on the concept on relation. Relation is the table
that consists of rows and columns. The rows of the table are called tuple and the
columns of the table are called attribute. Numbers of rows in the table is called as
cardinality. Number of columns in the table is called as degree.

HIERARCHICAL MODEL: In this type of model, we have multiple records for


each record. A particular record has one parent record. No child record can exist
without parent record. In this, the records are organized in tree.
NETWORK MODEL: In this, the data is represented by collection of records and
relationship is represented by ink or association.

CHARACTERISTICS OF MYSQL (DBMS)

 It reduces the redundancy


 Reduction of data in inconsistency
 Data sharing
 Data standardization

DIFFERENT TYPES OF FILES: -BASED ON ACCESS

 Sequential file
 Serial file
 Random (direct access) file BASED ON STORAGE:-
 Text file
 Binary File

Need of computerization
Student details and Result management is a python based project and we have
developed Student details and result management system using mysql and mysql
connector. It is easy to operate and understand by users. The entries of data is
done in a short period of time and it’s not time consuming. It ensures accurate
records and minimizes the inevitable and costly errors with manual data entry.

This accurate data helps to provide accurate performance.

Software programs constantly evolve. A program used today may be obsolete


within several years. Being trained on today's software does not guarantee it will
be used when you are ready to go out into the field. Understanding calculations is
timeless, as is computer competency. Software, however, shifts rapidly .

Merits
 It generates the report on the number of students taken examination.
 It deals with monitoring the information provided by the administrator.
 It increases the efficiency of managing student data.
 It has higher efficiency of editing, adding and updating of records.
 Provides the searching facilities on various factors
Demerits
 Excel export has not been developed for student database.
 The transactions are executed in offline mode only.
 Online transactions of student details or other data modifications are not possible.
 Offline reports cannot be generated

Input Screen & Output Screen


Program Code
import

mysql.connector

import sys
mydb = mysql.connector.connect(

host="localhost",

user="root",

password="Mohan@1972",

database="mydatabase"

conn = mydb.cursor()

conn.execute("CREATE TABLE if not exists STUDENT(ROLL_NO INT PRIMARY KEY NOT


NULL,NAME TEXT NOT NULL,FATHER_NAME TEXT NOT NULL,MOBILE_NO TEXT NOT
NULL,AGE INT NOT NULL,DEPARTMENT TEXT NOT NULL)")

conn.execute("CREATE TABLE if not exists RESULT(ROLL_NO INT PRIMARY KEY NOT


NULL,EXAMINATION TEXT NOT NULL,PHYSICS INT NOT NULL,CHEMISTRY INT NOT
NULL, MATHS INT NOT NULL, COMPUTER INT NOT NULL, ENGLISH INT NOT
NULL,FOREIGN KEY (ROLL_NO) REFERENCES STUDENT(ROLL_NO))")

conn.execute("SHOW TABLES")

for x in conn:

print(x)

conn.execute("select * from student")

myresult = conn.fetchall()

for x in myresult:

print(x)

conn.execute("select * from result")

myresult = conn.fetchall()

for x in myresult:

print(x)
#function to insert record

def insert_data():

ch="y"

while(ch=="y" or ch=="Y"):

i=0

stu_roll_no=int(input("\n\nENTER THE ROLL NUMBER :"))

sql = "SELECT * FROM STUDENT where ROLL_NO=%s"

conn.execute(sql, (stu_roll_no,))

a=conn.fetchall()

for row in a:

if(stu_roll_no == row[0]):

print("\nTHIS ROLL NUMBER ALREADY EXISTS")

print("\n1.UPDATE THE EXISTING RECORD\n2.INSERT NEW RECORD\nPRESS


ANY KEY TO GO BACK")

sel=input("\nENTER CHOICE : ")

if sel=='1':

update_data()

i=1

ch="n"

elif sel=='2':

ch="y"

i=1

else:

admin()

ch="n"

i=1
else:

break

if i!=1:

stu_name=input("ENTER STUDENT NAME :")

father_name=input("ENTER FATHER NAME :")

mobile=input("ENTER THE MOBILE NO :")

while(len(mobile)!=10):

mobile=input("\nPLEASE ENTER 10-DIGIT MOBILE NUMBER :")

stu_mobile_no=int(mobile)

stu_age=int(input("ENTER STUDENT AGE :"))

while(stu_age<=0 or stu_age>=30):

stu_age=int(input("\nENTER CORRECT STUDENT AGE"))

stu_dept=input("ENTER THE DEPARTMENT NAME :")

stu_dept.upper()

phy=int(input("ENTER MARKS IN PHYSICS :"))

chem=int(input("ENTER MARKS IN CHEMISTRY :"))

mat=int(input("ENTER MARKS IN MATHS :"))

comp=int(input("ENTER MARKS IN COMPUTER :"))

eng=int(input("ENTER MARKS IN ENGLISH :"))

exam=input("ENTER EXAMINATION NAME :")

conn.execute("insert into student


(ROLL_NO,NAME,FATHER_NAME,MOBILE_NO,AGE,DEPARTMENT) values (%s,%s,%s,%s,
%s,%s)",(stu_roll_no,stu_name,father_name,stu_mobile_no,stu_age,stu_dept))

conn.execute("insert into result


(ROLL_NO,PHYSICS,CHEMISTRY,MATHS,COMPUTER,ENGLISH,EXAMINATION)
values(%s,%s,%s,%s,%s,%s,%s)",(stu_roll_no,phy,chem,mat,comp,eng,exam))
print("\n\nRECORD ENTERED SUCCESSFULLY")

mydb.commit()

ch=input("\n\nWANT TO INSERT ANOTHER RECORD ? (Y/N) : ")

#function to update record

def update_data():

ch="y"

u=0

rn=int(input("\nENTER STUDENT ROLL NUMBER TO UPDATE RECORD :"))

sql = "SELECT * FROM STUDENT where ROLL_NO=%s"

conn.execute(sql, (rn,))

a=conn.fetchall()

for row in a:

if(rn == row[0]):

while(ch=="y" or ch=="Y"):

u=1

print("\n1.UPDATE STUDENT NAME ")

print("2.UPDATE FATHER NAME ")

print("3.UPDATE MOBILE NUMBER ")

print("4.UPDATE STUDENT AGE ")

print("5.UPDATE DEPARTMENT ")

print("6.UPDATE MARKS IN PHYSICS ")

print("7.UPDATE MARKS IN CHEMISTRY ")

print("8.UPDATE MARKS IN MATHEMATICS ")

print("9.UPDATE MARKS IN COMPUTER ")

print("10.UPDATE MARKS IN ENGLISH ")

print("11.UPDATE EXAMINATION NAME ")


choice = int(input("\nENTER YOUR CHOICE : "))

if (choice == 1):

up_name = input("\nENTER STUDENT NAME :")

q5 = "UPDATE STUDENT SET NAME=? where ROLL_NO=%s"

conn.execute(q5, (up_name, rn,))

print("\nNAME SUCCESSFULLY UPDATED")

elif(choice==2):

up_f_name = input("\nENTER FATHER NAME :")

q6 = "UPDATE STUDENT SET FATHER_NAME=%s where ROLL_NO=%s"

conn.execute(q6, (up_f_name, rn,))

print("\nFATHER NAME UPDATED SUCCESSFULLY")

elif(choice == 3):

mn = input("\nENTER MOBILE NUMBER :")

while(len(mn)!=10):

mn=input("\nPLEASE ENTER 10-DIGIT MOBILE NUMBER :")

up_mn=int(mobile)

q7 = "UPDATE STUDENT SET MOBILE_NO=%s where ROLL_NO=%s"

conn.execute(q7, (up_mn, rn,))

print("\nMOBILE NUMBER UPDATED SUCCESSFULLY")

elif(choice == 4):

up_age = int(input("\nENTER STUDENT AGE :"))

while(up_age<=0 or up_age>30):

up_age=int(input("\nENTER CORRECT STUDENT AGE"))

q15 = "UPDATE STUDENT SET AGE=%s where ROLL_NO=%s"

conn.execute(q15, (up_age, rn,))


print("\nAGE UPDATED SUCCESSFULLY")

elif(choice == 5):

up_dept = input("ENTER DEPARTMENT NAME :")

q8 = "UPDATE STUDENT SET DEPARTMENT=%s where ROLL_NO=%s"

conn.execute(q8, (up_dept, rn,))

print("\nDEPARTMENT NAME UPDATED SUCCESSFULLY")

elif(choice == 6):

up_python = int(input("ENTER MARKS IN PHYSICS :"))

q9 = "UPDATE RESULT SET PHYSICS=%s where ROLL_NO=%s"

conn.execute(q9, (up_python, rn,))

print("\nMARKS IN PHYSICS UPDATED SUCCESSFULLY")

elif(choice == 7):

up_rdbms = int(input("ENTER MARKS IN CHEMISTRY :"))

q10 = "UPDATE RESULT SET CHEMISTRY=%s where ROLL_NO=%s"

conn.execute(q10, (up_rdbms, rn,))

print("\nMARKS IN CHEMISTRY UPDATED SUCCESSFULLY")

elif(choice == 8):

up_cn = int(input("ENTER MARKS IN MATHEMATICS :"))

q11 = "UPDATE RESULT SET MATHS=%s where ROLL_NO=%s"

conn.execute(q11, (up_cn, rn,))

print("\nMARKS IN MATHEMATICS UPDATED SUCCESSFULLY")

elif(choice == 9):

up_os = int(input("ENTER MARKS IN COMPUTER :"))

q12 = "UPDATE RESULT SET COMPUTER=%s where ROLL_NO=%s"


conn.execute(q12, (up_os, rn,))

print("\nMARKS IN COMPUTER UPDATED SUCCESSFULLY")

elif(choice == 10):

up_ds = int(input("ENTER MARKS IN ENGLISH :"))

q13 = "UPDATE RESULT SET ENGLISH=%s where ROLL_NO=%s"

conn.execute(q13, (up_ds, rn,))

print("\nMARKS IN ENGLISH UPDATED SUCCESSFULLY")

elif(choice == 11):

up_exam =input("ENTER EXAMINATION NAME :")

q14 = "UPDATE RESULT SET EXAMINATION=%s where ROLL_NO=%s"

conn.execute(q14, (up_exam, rn,))

print("\nEXAMINATION NAME UPDATED SUCCESSFULLY")

else:

print("\nINVALID CHOICE\nCHOOSE AGAIN\n")

ch="y"

u+=1

mydb.commit()

if u==1:

ch=input("\nWANT TO UPDATE MORE RECORDS ? (Y/N): ")

if u==0:

print("\nTHIS ROLL NUMBER DOES NOT EXISTS IN RECORD")

print("\n1. INSERT THIS INTO DATABASE\n2. BACK TO ADMIN MODE")

sel=int(input("\nENTER CHOICE : "))

if sel==1:

insert_data()

else:

admin()
#function to delete record

def delete_data():

ch="y"

while(ch=="y" or ch=="Y"):

d=0

rn = int(input("\nENTER THE STUDENT ROLL NUMBER TO DELETE RECORD:"))

q0 = "SELECT * FROM STUDENT where ROLL_NO=%s"

conn.execute(q0, (rn,))

a=conn.fetchall()

for row in a:

if(rn == row[0]):

q3 = "delete from STUDENT where ROLL_NO=%s"

conn.execute(q3, (rn,))

q4 = "delete from RESULT where ROLL_NO=%s"

conn.execute(q4, (rn,))

print("\nRECORD DELETED SUCCESSFULLY")

mydb.commit()

d=1

ch=input("\nWANT TO DELETE MORE RECORDS ? (Y/N) : ")

if d==0:

print("\nNO SUCH RECORD EXISTS IN THE DATABASE")

admin()

#function to see records in user mode (it will not allow to edit)

def user():
ch="y"

while ch=="y" or ch=="Y":

v=0

rn=int(input("\nENTER THE ROLL NO :"))

q1 = "SELECT * FROM STUDENT where ROLL_NO=%s"

conn.execute(q1, (rn,))

a=conn.fetchall()

for row in a:

if(rn == row[0]):

print("\nROLL NUMBER :", row[0])

print("STUDENT NAME :", row[1])

print("FATHER NAME:", row[2])

print("PHONE NUMBER :", row[3])

print("STUDENT AGE :", row[4])

print("DEPARTMENT :", row[5])

v=1

else:

break

q2 = "SELECT * FROM RESULT where ROLL_NO=%s"

conn.execute(q2, (rn,))

b=conn.fetchall()

for row1 in b:

if(rn==row1[0]):

print("\nEXAMINATION NAME :", row1[1])

print("MARKS IN PHYSICS :", row1[2])

print("MARKS IN CHEMISTRY :", row1[3])

print("MARKS IN MATHS :", row1[4])

print("MARKS IN COMPUTER :", row1[5])

print("MARKS IN ENGLISH :", row1[6])


v=2

else:

break

if v!=2:

print("\nTHERE IS NO SUCH RECORD")

sel=int(input("\n1.VIEW ANOTHER\n2.RETURN\nENTER CHOICE : "))

if sel==1:

ch="y"

else:

return

else:

ch=input("\nWANT TO VIEW ANOTHER RECORD ? (Y/N): ")

#function to show database on condition

def view():

q1 = "SELECT * FROM STUDENT"

conn.execute(q1)

a=conn.fetchall()

print("\n........STUDENT TABLE........")

for row in a:

print("\n\nROLL NUMBER :", row[0])

print("STUDENT NAME :", row[1])

print("FATHER NAME:", row[2])

print("PHONE NUMBER :", row[3])

print("STUDENT AGE :", row[4])


print("DEPARTMENT :", row[5])

q2 = "SELECT * FROM RESULT"

conn.execute(q2)

b=conn.fetchall()

print("\n........RESULT TABLE........")

for row1 in b:

print("\n\nROLL NUMBER :", row1[0])

print("EXAMINATION NAME :", row1[1])

print("MARKS IN PHYSICS :", row1[2])

print("MARKS IN CHEMISTRY :", row1[3])

print("MARKS IN MATHEMATICS :", row1[4])

print("MARKS IN COMPUTER :", row1[5])

print("MARKS IN ENGLISH :", row1[6])

#login to database using authentication

def login():

username=input("\nENTER THE USERNAME :")

if(username=="ANKITH" or username=="ankith"):

password=input("ENTER THE PASSWORD :")

if(password=="password@123"):

print("\nLOGIN SUCCESSFUL")

admin()

else:

print("\nINVALID CREDENTIALS")

login()

else:
print("\nINVALID CREDENTIALS")

login()

#Administrator menu

def admin():

ch="y"

while(ch=="y" or ch=="Y"):

print("\n1. INSERT NEW RECORD IN DATABASE")

print("2. UPDATE RECORD IN DATABASE")

print("3. DELETE RECORD FROM DATABASE")

print("4. SHOW DATABASE")

print("5. EXIT")

choice = int(input("\nENTER YOUR CHOICE :"))

if (choice==1):

insert_data()

elif (choice== 2):

update_data()

elif (choice==3):

delete_data()

elif(choice==4):

view()

elif(choice==5):

sys.exit()

else:

print("\nPLEASE ENTER THE VALID CHOICE")

admin()

ch=input("\nWANT TO CONTINUE TO ADMIN MODE ?(Y/N) : ")


#main menu program

#main program

ch="y"

while(ch=="y" or ch=="Y"):

print("\n\n..........STUDENT DETAILS & EXAMINATION RESULT MANAGEMENT


SYSYTEM............")

print("\n\n\n1. ADMINISTRATION MODE")

print("2. USER MODE")

print("3. EXIT")

choice=int(input("\nENTER YOUR CHOICE :"))

if(choice == 1):

login()

ch="n"

elif(choice == 2):

user()

ch="n"

elif(choice == 3):

sys.exit(0)

else:

print("\nINVALID CHOICE")

sys.exit()

Future enhancements
1. The process of gathering information, diagnosing the problems, then
interpreting facts is known as System analysis. It also includes
recommending system improvements needed, based on the same data.
2. The system is observed as a whole; the inputs need to be identified firstly
before turning them and then the system is subjected to study as a whole to
identify the problem areas.

3. Although tuning any system as a whole is a complex procedure, but tuning


individual statements is not the best as something that is correct for one
input may hurt another inputs performance.

4. The solutions are given as a proposal. The suggestion is revised on user


request and optimal changes are made. This loop terminates as soon as the
user is gratified with the proposal.

5. So on the whole, system analysis is done to improve the system


performance by monitoring it and obtaining the best throughput possible
from it. Therefore system analysis plays a crucial role in designing any
system.

You might also like