0% found this document useful (0 votes)
129 views

Ip Project

This document defines functions for a student management system with the following capabilities: 1. It allows navigation between options to view student details, marks, and fees records. 2. The student details section allows adding, editing, and viewing student records stored in a database. 3. The student marks section allows adding, editing, and viewing student marks records stored in a database. 4. The fees records section allows adding, editing, viewing, and updating fees payment records stored in a database.

Uploaded by

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

Ip Project

This document defines functions for a student management system with the following capabilities: 1. It allows navigation between options to view student details, marks, and fees records. 2. The student details section allows adding, editing, and viewing student records stored in a database. 3. The student marks section allows adding, editing, and viewing student marks records stored in a database. 4. The fees records section allows adding, editing, viewing, and updating fees payment records stored in a database.

Uploaded by

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

def main():

print("*****************************")
print("STS STUDENTS MANAGMENT SYSTEM")
print("*****************************")
print("****WELCOME TO MY PROJECT****")
A=int(input("ENTER PASSWORD-"))
if A == 5174:
Navigator()
else:
print("WRONG PASSWORD")
def Navigator():
c='y'
while(c=='y'):
print("1. STUDENTS DETAILS")
print("2. STUDENTS MARKS")
print("3. FEES RECORD")
print("4. Exit")
print("5. FIELDS OF TABLES")
ch= int (input("Enter your Choice:-"))
if ch == 1:
students_details()
elif ch == 2:
student_marks()
elif ch==3:
fees_record()
elif ch == 4:
print("Exiting")
break
elif ch == 5:
fields()
else:
print("Wrong input")
c=input("Do you Want to continue ")
def students_details():
c='y'
while(c=='y'):
print("1. ADD STUDENT ")
print("2. EDIT DETAILS ")
print("3. ERASE DETAILS ")
print("4. SHOW ALL DETAILS ")
print("5. EXIT")
print()
ch= int (input("Enter your Choice:-"))
if ch == 1:
add_data()
elif ch == 2:
Edit()
elif ch == 3:
Erase()
elif ch == 4:
show()
elif ch == 5:
print("Exiting")
break
else:
print("Wrong input")
c=input("Do you Want to continue ")
def show():
import mysql.connector as sqltor
try:
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
cursor.execute("select *from student_details")
res = cursor.fetchall()
for x in res:
print(x)
except:
print ("Error: Not Fetch")

def add_data():
import mysql.connector as sqltor
try:
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
adm= int(input("Addmisson no. "))
roll=int(input("Enter roll no. "))
name = input("Enter student name ")
clas= int(input("class "))
sec = input("section ")
add=input("Address ")
ft=input("Father name ")
mo=input("Mother name ")
dt=input("Date of birth ")
rec="insert into student_details values(%d,%d,'%s',
%d,'%s','%s','%s','%s','%s')"%(adm,roll,name,clas,sec,add,ft,mo,dt)
rec="insert into student_details values({},{},'{}',
{},'{}','{}','{}','{}','{}')".format(adm,roll,name,clas,sec,add,ft,mo,dt)
cursor.execute(rec)
mycon.commit()
print(cursor.rowcount,"Record Inserted Successfully ")
except Exception as e:
print(e)
def Edit():
import mysql.connector as sqltor
try:
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
adm=int(input("ENTER ADDMISSON NUMBER OF STUDENT WHOSE DETAILS TO BE UPDATE
"))
qry="select * from student_details where addmisson_no=%d"%adm
cursor.execute(qry)
data=cursor.fetchall()
if len(data)==0:
print("STUDENT NOT FOUND")
else:
roll= int(input("Enter new roll no. "))
name = input("Enter new student name ")
clas= int(input("class "))
sec = input("section ")
add=input("Enter new Address ")
ft=input("Father name ")
mo=input("Mother name ")
dt=input("Date of birth ")
qry="update Student_details SET roll_no=%d,name='%s',class=
%d,section='%s',address='%s',father_name='%s',mother_name='%s',dob='%s' where
addmisson_no=%d"%(roll,name,clas,sec,add,ft,mo,dt,adm)
cursor.execute(qry)
print("STUDENT RECORD UPDATED")
mycon.commit()
except:
print("SORRY SOME ERROR OCCURED")
def Erase():
import mysql.connector as sqltor
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
name = input("Enter Name of Student ")
sql= "delete from student_details where name= '{}'".format(name)
cursor.execute(sql)
print(cursor.rowcount, "Delete Record")
mycon.commit()
def student_marks():
c='y'
while(c=='y'):
print("1:TO DISPLAY ALL DATA")
print("2:TO ADD NEW STUDENT")
print("3:TO CHANGE MARKS OF STUDENT")
print("4:TO DELETE STUDENT ")
print("5:EXIT")
print()
ch=int(input("ENTER YOUR CHOICE "))
if ch == 1:
show2()
elif ch == 2:
add2()
elif ch == 3:
edit2()
elif ch ==4:
erase2()
elif ch == 5:
print("Exiting")
break
else:
print("Wrong input")
c=input("Do you Want to continue ")

def show2():
import mysql.connector as sqltor
try:
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
cursor.execute("select *from student_marks")
res = cursor.fetchall()
for x in res:
print(x)
except:
print ("Error: Not Fetch")

def add2():
import mysql.connector as sqltor
try:
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
r=int(input("Enter student roll number "))
name=input("ENTER STUDENT NAME ")
c=input("ENTER CLASS OF STUDENT ")
s=input("ENTER SECTION OF STUDENT ")
m1=int(input("ENTER MARKS IN ECONOMICS "))
m2=int(input("ENTER MARKS IN ENGLISH "))
m3=int(input("ENTER MARKS IN ACCOUNTS "))
m4=int(input("ENTER MARKS IN BUSINESS "))
m5=int(input("ENTER MARKS IN IP "))
t=m1+m2+m3+m4+m5
per=t/5
rec="insert into student_marks values(%d,'%s','%s','%s',%d,%d,%d,%d,%d,%d,
%d)"%(r,name,c,s,m1,m2,m3,m4,m5,t,per)
#rec="insert into student_marks values({},'{}','{}','{}',{},{},{},{},{},{},
{})".format(r,name,c,s,m1,m2,m3,m4,m5,t,per)
cursor.execute(rec)
print("STUDENT RECORD SAVED IN TABLE")
mycon.commit()
print(cursor.rowcount,"Record Inserted Successfully")
except Exception as e:
print(e)
def edit2():
import mysql.connector as sqltor
try:

mycon=sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor=mycon.cursor()
roll=int(input("ENTER ROLL NUMBER OF STUDENT WHOSE MARKS TO BE UPDATE "))
qry2="select * from student_marks where roll_no=%d"%roll
cursor.execute(qry2)
data=cursor.fetchall()
if len(data)==0:
print("STUDENT NOT FOUND")
else:
m1=int(input("ENTER UPDATED MARKS IN ECONOMICS "))
m2=int(input("ENTER UPDATED MARKS IN ENGLISH "))
m3=int(input("ENTER UPDATED MARKS IN ACCOUNTS "))
m4=int(input("ENTER UPDATED MARKS IN BUSINESS "))
m5=int(input("ENTER UPDATED MARKS IN IP "))
t=m1+m2+m3+m4+m5
per=t/5
qry2="update Student_marks SET economics=%d,english=%d,accounts=
%d,business=%d,ip=%d,total=%d,percent=%d where roll_no=%d"%
(m1,m2,m3,m4,m5,t,per,roll)
#qry2="update Student_marks SET
economics={},english={},accounts={},business={},ip={},total={},percent={} where
roll_no={}".format(m1,m2,m3,m4,m5,t,per,roll)
cursor.execute(qry2)
print("STUDENT RECORD UPDATED")
mycon.commit()
except Exception as e:
print(e)
def erase2():
import mysql.connector as sqltor
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
roll=int(input("ENTER STUDENT ROLL NUMBER ,YOU WANT TO DELETE"))
qry2="select * from student_marks where roll_no=%d"%roll
cursor.execute(qry2)
data=cursor.fetchall()
if len(data)==0:
print("STUDENT NOT FOUND IN TABLE")
else:
qry2="delete from student_marks where roll_no=%d"%(roll)
cursor.execute(qry2)
print("STUDENT RECORD DELETED FROM TABLE")
mycon.commit()
def fees_record():
c='y'
while(c=='y'):
print("1:TO ADD RECORD")
print("2:TO DISPLAY ALL RECORD")
print("3:TO UPDATE FEES RECORD")
print("4:TO DELETE STUDENT RECORD ")
print("5:EXIT")
print()
ch=int(input("ENTER YOUR CHOICE "))
if ch == 1:
add3()
elif ch == 2:
show3()
elif ch == 3:
edit3()
elif ch ==4:
erase3()
elif ch == 5:
print("Exiting")
break
else:
print("Wrong input")
c=input("Do you Want to continue")
def add3():

import mysql.connector as sqltor

mycon=sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor=mycon.cursor()
name=input("enter name of student ")
print("PRESS 'Y' IF FEES IS PAID")
jul=input("JULY ")
aug=input("AUGUST ")
sep=input("SEPTEMBER ")
oct=input("OCTOMBER ")
nov=input("NOVEMBER ")
dec=input("DECEMBER ")
jan=input("JANUARY ")
feb=input("FEBURARY ")
mar=input("MARCH ")
apr=input("APRIL ")
if jul=='y':
a1='fees paid'
else:
a1='not paid'
if aug=='y':
a2='fees paid'
else:
a2='not paid'
if sep=='y':
a3='fees paid'
else:
a3='not paid'
if oct=='y':
a4='fees paid'
else:
a4='not paid'
if nov=='y':
a5='fees paid'
else:
a5='not paid'
if dec=='y':
a6='fees paid'
else:
a6='not paid'
if jan=='y':
a7='fees paid'
else:
a7='not paid'
if feb=='y':
a8='fees paid'
else:
a8='not paid'
if mar =='y':
a9='fees paid'
else:
a9='not paid'
if apr =='y':
a10='fees paid'
else:
a10='not paid'
fee="insert into student_fees
values('{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}')".format(name,a1,a2,a
3,a4,a5,a6,a7,a8,a9,a10)
cursor.execute(fee)
mycon.commit()
def edit3():
import mysql.connector as sqltor
try:

mycon=sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor=mycon.cursor()
name=input("ENTER NAME OF STUDENT WHOSE RECORD TO BE UPDATE ")
qry="select * from student_fees where name='{}'".format(name)
cursor.execute(qry)
data=cursor.fetchall()
if len(data)==0:
print("STUDENT NOT FOUND")
else:
jul=input("JULY ")
aug=input("AUGUST ")
sep=input("SEPTEMBER ")
oct=input("OCTOMBER ")
nov=input("NOVEMBER ")
dec=input("DECEMBER ")
jan=input("JANUARY ")
feb=input("FEBURARY ")
mar=input("MARCH ")
apr=input("APRIL ")
if jul=='y':
a1='fees paid'
else:
a1='not paid'
if aug=='y':
a2='fees paid'
else:
a2='not paid'
if sep=='y':
a3='fees paid'
else:
a3='not paid'
if oct=='y':
a4='fees paid'
else:
a4='not paid'
if nov=='y':
a5='fees paid'
else:
a5='not paid'
if dec=='y':
a6='fees paid'
else:
a6='not paid'
if jan=='y':
a7='fees paid'
else:
a7='not paid'
if feb=='y':
a8='fees paid'
else:
a8='not paid'
if mar =='y':
a9='fees paid'
else:
a9='not paid'
if apr =='y':
a10='fees paid'
else:
a10='not paid'

qry3="update Student_fees SET


july='{}',august='{}',september='{}',octomber='{}',november='{}',december='{}',janu
ary='{}',february='{}',march='{}',april='{}' where
name='{}'".format(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,name)
cursor.execute(qry3)
print("STUDENT RECORD UPDATED")
mycon.commit()
except Exception as e:
print(e)
def show3():
import mysql.connector as sqltor
try:
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
cursor.execute("select *from student_fees")
res = cursor.fetchall()
for x in res:
print(x)
except:
print ("Error: Not Fetch")
def erase3():
import mysql.connector as sqltor
mycon =
sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor = mycon.cursor()
name = input("Enter Name of Student to delete ")
sql= "delete from student_fees where name= '{}'".format(name)
cursor.execute(sql)
print(cursor.rowcount, "Delete Record")
mycon.commit()
def fields():
import mysql.connector as sqltor
mycon=sqltor.connect(host="localhost",user="root",passwd="root",database="scl")
cursor=mycon.cursor()
try:
table=input("enter table name ")
cursor.execute("desc %s"%table)
for i in cursor:
print(i)
except:
print("sorry some error occured")

#menu()
#Navigator()
main()

You might also like