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

CS Main

Uploaded by

patelveer379
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)
6 views20 pages

CS Main

Uploaded by

patelveer379
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/ 20

INTRODUCTION

This project works on showing the mechanism of


RESULT PORTAL which consists of tasks such as login
of teachers, login of students, uploading of results,
deleting of results, editing of results, displaying of
results,etc.

DBMS:
• The software requires for management of data is
called DBMS. It has three models.

• Relation model: It stores information in form of


rows (cardinality) and columns (degree).

• Hierarchical model: In this type of model, we have


multiple records inside a single record.

• Network model: In this, the data is represented by


collections of record and relationships is separated
by associations.
CHARACTERISTICS OF DBMS:

• It reduces the redundancy.


• Data sharing.
• Data standardization.
• Reduction of data inconsistency.
SOFTWARE AND HARDWARE REQUIREMENTS:

Software Specifications:-
• Operating system : Windows 10/8/7 or higher
• Platform : Python IDLE 3.12.4
• Database : MySQL
• Languages : Python

Hardware Specifications:-
• Processor : Dual core or above
• Hard Disk : 40 GB
• RAM : 1024 MB

Advantages of Project:
1. Saves time of teachers and administrators.
2. eResult display.
3. eResult editing.
4. Effortless grades and marks management.
5. Easy to handle.

TOOLS AND TECHNOLOGY:

PYHTON is a dynamic , high level , free open source


and interpreted language. It supports object-oriented
programming a well as procedural oriented
programming.
MODULE USED:

Mysql.connector: It is a module which is used to


establish connection between MySql and python.

FEATURES OF PYTHON:-

• Easy To Learn and Readable Language.


• Python is extremely easy to learn.
• Interpreted Language.
• Dynamically Typed Language.
• Open Source and Free.
• Large Standard Library.
• High-Level Language.
• Object Oriented Programming Language.
• Large Standard Library.
SOURCE CODE OF PYTHON:

#MODULE IMPORT
import mysql.connector as con

#FUNCTION DEFINATIONS
def login_teacher():
cur.execute("Select * from login_teacher;")
x=cur.fetchall()
u_id=input("Enter Teacher ID: ")
password=input("Enter password: ")
for i in x:
if i[0]==u_id and i[1]==password:
print("Login successfull")
break
else:
print("Invalid Teacher ID or password")

def login_student():
cur.execute("Select * from login_student;")
x=cur.fetchall()
u_id=input("Enter Student ID: ")
password=input("Enter password: ")
for i in x:
if i[0]==u_id and i[1]==password:
print("Login successfull")
break
else:
print("Invalid Student ID or password")

def insert_teacher():
u_id=input("Set your user ID: ")
pwd=input("Set your password: ")
x="insert into login_teacher(u_id,pwd)values(%s,%s)"
tup=(u_id,pwd)
cur.execute(x,tup)
db.commit()
print("Account Created!!")

def insert_student():
u_id=input("Set your user ID: ")
pwd=input("Set your password: ")
x="insert into login_student(u_id,pwd)values(%s,%s)"
tup=(u_id,pwd)
cur.execute(x,tup)
db.commit()
print("Account Created!!")
def result_attach():
u_id=input("Enter Student's ID : ")
name=input("Enter Student's name : ")
clas=input("Enter you class: ")
DOB=input("Enter DOB(YYYY-MM-DD): ")
phy=input("Enter Physics marks: ")
math=input("Enter Maths marks: ")
chem=input("Enter Chemistry marks: ")
cs=input("Enter CS marks: ")
eng=input("Enter English marks: ")
x="insert into results(u_id,name,clas,DOB,phy,math,chem,cs,eng)
values(%s,%s,%s,%s,%s,%s,%s,%s,%s)"
tup=(u_id,name,clas,DOB,phy,math,chem,cs,eng)
cur.execute(x,tup)
db.commit()
print("Result Uploaded!!")

def display_result():
l=[1,"NAME: ","CLASS: ","DOB: ","PHYSICS: ","MATHS:
","CHEMISTRY: ","CS: ","ENGLISH: "]
u_id=input("Enter your Student ID: ")
x="select * from results where u_id=%s;"
tup=(u_id,)
cur.execute(x,tup)
result=cur.fetchone()
for i in range(1,9):
print(l[i]+str(result[i]))

def update():
l=[1,"update results set name=%s where u_id=%s;",
"update results set clas=%s where u_id=%s;",
"update results set DOB=%s where u_id=%s;",
"update results set phy=%s where u_id=%s;",
"update results set math=%s where u_id=%s;",
"update results set chem=%s where u_id=%s;",
"update results set cs=%s where u_id=%s;",
"update results set eng=%s where u_id=%s;"]
print("1:Name\n2:Class\n3:DOB(YYYY-MM-DD)\n4:Physics\n5:
Math\n6: Chemistry\n7: CS\n8: English")
change=int(input("Enter your choice: "))
u_id=input("Enter Student's ID where you want to change: ")
new=input("Enter new record: ")
y=str(l[change])
tup=(new,u_id)
cur.execute(l[change],tup)
db.commit()
print("Result updated!!")

def delete():
u_id=input("Enter the Student's ID to delete result: ")
x="delete from results where u_id=%s"
tup=(u_id,)
cur.execute(x,tup)
db.commit()
print("Result Deleted Successfully")
#MAIN
db=con.connect(host="localhost",user="root",password="Veer@_61
2",database="cspractical")
cur=db.cursor()

print("WELCOME")
while True:
print(" \n1 -> TEACHER\n2 -> STUDENT\n3 -> EXIT\n ")
z=int(input("Enter your choice: "))
if z==1:
while True:
print(" \nFOR TEACHERS\n1 -> LOGIN\n2 -> CREATE
ACCOUNT\n3 -> EXIT\n ")
x=int(input("Enter your choice: "))
if x==1:
login_teacher()
while True:
print(" \n1 -> UPLOAD RESULT\n2 -> EDIT RESULT\n3
-> DELETE RESULT\n4 -> DISPLAY RESULT\n5 -
> EXIT\n ")
result=int(input("Enter your choice: "))
if result==1:
result_attach()
elif result==2:
update()
elif result==3:
delete()
elif result==4:
display_result()
elif result==5:
break
else:
print("Invalid choice")
elif x==2:
insert_teacher()
break
elif x==3:
break
else:
print("Invalid choice")
elif z==2:
while True:
print(" \nFOR STUDENTS\n1 -> LOGIN\n2 -> CREATE
ACCOUNT\n3 -> EXIT\n ")
x=int(input("Enter your choice: "))
if x==1:
login_student()
while True:
print(" \n1 -> DISPLAY RESULT\n2 -> EXIT\n ")
result=int(input("Enter your choice: "))
if result==1:
display_result()
elif result==2:
break
else:
print("Invalid choice")
elif x==2:
insert_student()
break
elif x==3:
break
else:
print("Invalid choice")
elif z==3:
break
else:
print("Invalid choice")
MYSQL TABLES:

DETAIL OF TABLES:
TABLES WITH VALUES:
DATA ENTRIES:

• ADDING STUDENT ID:

• ADDING TEACHER ID:


• TEACHER’S LOGIN:

• UPLOADING STUDENT RESULT:


• UPLOADED RESULT IN MYSQL:

• EDITING STUDENT RESULT:


• EDITED RESULT IN MYSQL:

• EDITED RESULT IN PYTHON:


• DELETING STUDENT RESULT:

• DELETED RESULT IN MYSQL:


• STUDENT’S LOGIN:

• STUDENT DISPLAYS RESULT:


BIBLIOGRAPHY:

• KIPS Textbook
• Respected Subject Teacher

You might also like