Student Management
Student Management
COMPUTER SCIENCE
PROJECT
1
STUDENT MANAGEMENT SYSTEM
Table of content
Acknowledgement
Certificate
Introduction
Objective
Database
Source Code
Program Output
Bibliography
2
STUDENT MANAGEMENT SYSTEM
Introduction
This application has a keen eye on each information of student. It keeps all
records within the database. This System is not only profitable to teacher but also
to the student for maintaining their record. Teacher can easily get the details of
student. There is no problem regarding with this software and can easily be
handle by the teacher.
3
STUDENT MANAGEMENT SYSTEM
Objective
4
STUDENT MANAGEMENT SYSTEM
Software Python
Notepad
MS WORD
MYSQL
5
STUDENT MANAGEMENT SYSTEM
Database
6
STUDENT MANAGEMENT SYSTEM
Source Code
import student_module as cm
cm.cls()
print("\t\t\t\t\tWELCOME TO STUDENT MANAGEMENT SYSTEM")
ch=input("\tIf you are working first time in the system then press Y or y other wise press N or n :")
if ch in ('Y','y'):
cm.database()
cm.table()
while True:
print("\t\t\t\t\tWELCOME TO STUDENT MANAGEMENT SYSTEM")
print("\t\t\t\t\tEnter 1 to Insert detail of a student")
print("\t\t\t\t\tEnter 2 to Update record of a student")
print("\t\t\t\t\tEnter 3 to Delete record of student")
print("\t\t\t\t\tEnter 4 to Generate Report Card")
print("\t\t\t\t\tEnter 5 to Show details of all students")
print("\t\t\t\t\tEnter 6 to Insert Marks in Examination")
print("\t\t\t\t\tEnter 7 to exit")
ch=input("\t\t\t\t\tEnter your choice :\t")
if ch=='1':
cm.cls()
cm.insert()
elif ch=='2':
cm.cls()
cm.update()
elif ch=='3':
cm.cls()
cm.delete()
elif ch=='4':
cm.cls()
cm.reportcard()
print("\n\n\n")
elif ch=='5':
cm.cls()
cm.showall()
print("\n\n\n")
elif ch=='6':
cm.cls()
cm.marks()
elif ch=='7':
cm.cls()
print("\t\t\t\t\tTHANK YOU FOR USING STUDENT MANAGEMENT SYSTEM")
break
7
STUDENT MANAGEMENT SYSTEM
else:
print("\t\t\t\t\tYOU HAVE CHOOSE WRONG OPTION PLEASE CHOOSE CORRECT ONE")
import mysql.connector
def cls():
print("\n"*40)
def database():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="")
ss=mydb.cursor()
db="create database student_management"
ss.execute(db)
mydb.close()
ss.close()
print("\n\n\n")
def table():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='student_managem
ent')
ss=mydb.cursor()
ss.execute("create table student(rno int(5) primary key, name char(30) not null, fname char(30),
mname char(30), dob date, cno int(12), ut1 int(3), hy int(3), ut2 int(3), final int(3))")
mydb.close()
ss.close()
print("\n\n\n")
def insert():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='student_managem
ent')
ss=mydb.cursor()
insertrecord="insert into student (rno,name,fname,mname,dob,cno)values(%s,%s,%s,%s,%s,%s)"
rno=int(input("\t\t\t\t\tEnter Roll No :"))
name=input("\t\t\t\t\tEnter Student Name :")
fname=input("\t\t\t\t\tEnter Father Name :")
mname=input("\t\t\t\t\tEnter Mother Name :")
dob=input("\t\t\t\t\tEnter Date of Birth as YYYY-MM-DD :")
cno=input("\t\t\t\t\tEnter Contact No :")
ss.execute(insertrecord,(rno,name,fname,mname,dob,cno))
mydb.commit()
mydb.close()
ss.close()
print("\n\n\n")
def update():
8
STUDENT MANAGEMENT SYSTEM
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='student_managem
ent')
ss=mydb.cursor()
rno=int(input("\t\t\t\t\tEnter Roll No :"))
print("\t\t\t\t\tEnter 1 to Change Student Name")
print("\t\t\t\t\tEnter 2 to Change Student Father Name")
print("\t\t\t\t\tEnter 3 to Change Student Mother Name")
print("\t\t\t\t\tEnter 4 to Change Student Contact No")
print("\t\t\t\t\tEnter 5 to Change Student Date Of Birth")
ch=input("\t\t\t\tEnter Your Choice")
if ch=='1':
name=input("\t\t\t\t\tEnter Correct Name of Student :")
ud="update student set name=%s where rno=%s"
ss.execute(ud,(name,rno))
elif ch=='2':
fname=input("\t\t\t\t\tEnter Correct Name of Father :")
ud="update student set fname=%s where rno=%s"
ss.execute(ud,(fname,rno))
elif ch=='3':
mname=input("\t\t\t\t\tEnter Correct Name of Mother :")
ud="update student set mname=%s where rno=%s"
ss.execute(ud,(mname,rno))
elif ch=='4':
cno=input("\t\t\t\t\tEnter Correct Contact No :")
ud="update student set cno=%s where rno=%s"
ss.execute(ud,(cno,rno))
elif ch=='5':
dob=input("\t\t\t\t\tEnter Correct Date Of Birth :")
ud="update student set dob=%s where rno=%s"
ss.execute(ud,(dob,rno))
else:
print("\t\t\t\t\tYour Choice is Wrong")
mydb.commit()
print("\t\t\t\t\tRecord is succesfully updated")
print("\n\n\n")
mydb.close()
ss.close()
def delete():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='student_managem
ent')
ss=mydb.cursor()
rno=input("\t\t\t\t\tEnter Roll No :")
deleterec="delete from student where rno=%s"
ss.execute(deleterec,(rno,))
mydb.commit()
9
STUDENT MANAGEMENT SYSTEM
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='student_managem
ent')
ss=mydb.cursor()
rno=input("\t\t\t\t\tEnter Roll No :")
record="select * from student where rno=%s"
ss.execute(record,(rno,))
rec=ss.fetchall()
for x in rec:
print("Roll No\tStudent Name\tFather Name\tMother Name\tDate Of Borth\tContact No\tUnit
Test1\tHalf Yearly\tUnit Test2\tFinal")
print(x[0],"\t",x[1],"\t",x[2],"\t",x[3],"\t",x[4],"\t",x[5],"\t",x[6],"\t\t",x[7],"\t\t",x[8],"\t\t",x[9])
mydb.close()
ss.close()
print("\n\n\n")
def showall():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='student_managem
ent')
ss=mydb.cursor()
record="select * from student"
ss.execute(record)
rec=ss.fetchall()
print("Roll No\tStudent Name\tFather Name\tMother Name\tDate Of Borth\tContact No\tUnit Test1\
tHalf Yearly\tUnit Test2\tFinal")
for x in rec:
print(x[0],"\t",x[1],"\t",x[2],"\t",x[3],"\t",x[4],"\t",x[5],"\t",x[6],"\t\t",x[7],"\t\t",x[8],"\t\t",x[9])
mydb.close()
ss.close()
print("\n\n\n")
def marks():
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database='student_managem
ent')
ss=mydb.cursor()
rno=int(input("Enter Roll No :"))
print("\t\t\t\t\tEnter 1 to Insert Marks of Unit Test 1 :")
print("\t\t\t\t\tEnter 2 to Insert Marks of Half Yearly :")
print("\t\t\t\t\tEnter 3 to Insert Marks of Unit Test 2 :")
print("\t\t\t\t\tEnter 4 to Insert Marks of Final :")
ch=input("\t\t\t\t\tEnter Your Choice")
if ch=='1':
10
STUDENT MANAGEMENT SYSTEM
//**********************************************************************\\
// END OF CODE \\
//*************************************************************************\\
11
STUDENT MANAGEMENT SYSTEM
Program Output
12
STUDENT MANAGEMENT SYSTEM
13
STUDENT MANAGEMENT SYSTEM
14
STUDENT MANAGEMENT SYSTEM
Bibliography
Sumita Arora
Preeti Arora
google.com
15