Sms Final
Sms Final
• Student Search
The `search_student()’ function allows administrators to
search for student details based on the student’s name.
This ensures quick access to comprehensive information,
such as admission number, name, gender, class, section,
phone number, email ID, and stream.
• Delete Student
The `delete_student()` function enables administrators to
remove student records from the system, providing a
mechanism for data clean up and management.
2)USER-FRIENDLY INTERFACE
The project recognizes the importance of user experience
for both administrators and end-users. Two distinct
panels, namely the Admin Panel and the User Panel, cater
to the unique needs of these user groups.
•User Panel
The `user()` function represents the User Panel, providing
as implified interface for end-users to search for their
details, view academic information, and exit the system.
i) Search Student
The `search_student()` function utilizes SQL queries to
search for student details based on the provided name,
returning a detailed display of relevant information.
ii) View Student Details
The `view_Marks()` function employs SQL queries to fetch
and display student details, with a specific focus on
academic performance.
•Update Operations
iii) Update Student Details
The `update_details()` function integrates user input and
SQL queries to selectively update student information,
offering granular control over the data modification
process.
v)Delete Student
The `delete_student()` function utilizes SQL queries to
delete student records based on the provided name,
contributing to data management and cleanup.
INTEGRATION OF MYSQL
AND PYTHON:
•MY SQL-THE RELATIONAL DATABASE
MANAGEMENT SYSTEM
MySQL serves as the back end data base for the Student
Management System, storing and managing student-
related information. The structured schema ensures
efficient to rage, retrieval, and manipulation of data.
if len(a)>=1: for i in a:
print(“Admission no:”,i[0])
print(“Name is:”,i[1])
print(“Sex:”,i[2])
print(“Class=”,i[3])
print(“Sec:”,i[4])
print(“Phone number is=”,i[5])
print(“Email_id:”,i[6])
print(“Stream is:”,i[7])
print(“--------------------------------------------“)
else:
print(“Students Details Not Found”)
#To update details of students from student details table
def update_details():
D=con.connect(host=”localhost”, user=”root”,
password=”admin”,
database=”STUDENT_MANAGEMENT_SYST EM”)
C=d.cursor()
print(“1. Update Name”)
print(“2. Update Gender”)
print(“3. Update class”)
print(“4. Update Section”)
print(“5.UpdatePhoneno.”)
print(“6. Update E-mail id”)
print(“7. Update Stream”)
Opt=int(input(“Enter your choice to update”))
if opt==1:
print(“-------------------------------------------------“)
print(“You are inside updating name.”)
Q=input(“Enter ADMISSION_NUMBER whose
data you want to update: “)
L=input(“Enter your updated name:“)
c.execute(“update STUDENT_DETAILS set
NAME=’{}’ where
ADDMISSION_NUMBER={}”.format(l,q))
d.commit()
elif opt==2:
print(“---------------------------------------------------“)
print(“YouareinsideupdatingGender.”)
p=input(“Enternamewhosedatayouwantto
update: “)
l=input(“EnteryourupdatedGender:“)
c.execute(“update STUDENT_DETAILS set
SEX=’{}’ where name=’{}’”.format(l,p))
d.commit()
elif opt==3:
print(“--------------------------------------------“)
print(“You are inside updating class.”)
m=input(“Enternamewhosedatayouwantto
update: “)
n=input(“Enter your updated class: “)
c.execute(“update STUDENT_DETAILS set
CLASS={} where name=’{}’”.format(n, m))
d.commit()
elif opt==4:
print(“-------------------------------------------------“)
print(“You are inside updating section.”)
y=input(“Enter name whose data you want to
update: “)
e=input(“Enter your updated section:“)
c.execute(“update STUDENT_DETAILS set
SEC=’{}’ where name=’{}’”.format(e, y))
d.commit()
elif opt==5:
print(“------------------------------------------“)
print(“You are inside updating phone
number.”)
h=input(“Enter name whose data you want to
update: “)
r=input(“Enter your updated phone number:“)
d.commit()
elif opt==6:
print(“-------------------------------------------------“)
print(“You are inside updating email_id.”)
j=input(“Enter name whose data you want to
update: “)
k=input(“Enter your updated email_id:“)
c.execute(“update STUDENT_DETAILS set
EMAIL_ID=’{}’where name=’{}’”.format(k,j))
d.commit()
elif opt==7:
print(“-------------------------------------------------“)
print(“You are inside updating stream.”)
f=input(“Enter name whose data you want to
update: “)
z=input(“Enter your updated stream : “)
c.execute(“update STUDENT_DETAILS set
STREAM=’{}’ where NAME=’{}’”.format(z,f))
d.commit()
else:
update_details()
for i in s:
print(“MARKS:”,i[8])
print(“------------------------------------------“)
d.commit()
#To insert details to student details table
defadd_student():
print(“..................ADD STUDENT
DETAILS......................”)
N=input(“Enter student name: “)
A=int(input(“Enter student admission number:“))
R=input(“Enter gender of student: “)
I=int(input(“Enter class of student:”))
P=input(“Enter student section:“)
T=int(input(“Enter student phone number:”))
W=input(“Enter student stream: “)
U=input(“Enter your mail id:”)
M=int(input(“Enter your marks:”))
D=con.connect(host=”localhost”,user=”root”,password=”a
dmin”,database=”STUDENT_MANAGEMENT_SYST EM”)
C=d.cursor()
Sq=”insertintoSTUDENT_DETAILS
values({},’{}’,’{}’,{},’{}’,{},’{}’,’{}’,{})”.format(a,n,r,i,p,t,u,
w,m)
c.execute(sq) d.commit()
print(“studentdataaddedsuccessfully”)
#Todeleteitemsfromstudentdetailstable def
delete_student():
print(“********************DELETESTUDENT
DETAILS*******************”)
K=input(“EnternametoDELETEstudentdetails:“)
D=con.connect(host=”localhost”,user=”root”,password=”a
dmin”,database=”STUDENT_MANAGEMENT_SYST EM”)
C=d.cursor()
c.execute(“deletefromSTUDENT_DETAILSwhere
name=’{}’”.format(k))
print(“.........Datadeletedsuccessfully............”)
d.commit()
#Tosearchstudentsfromstudentdetails
table.
defsearch():
print(“*****************STUDENT
DETAILS***********************”)
K=input(“Enternametosearchstudentdetails:“)
D=con.connect(host=”localhost”,user=”root”,password=”a
dmin”,database=”STUDENT_MANAGEMENT_SYST EM”)
C=d.cursor()
c.execute(“select*fromSTUDENT_DETAILSwhereNAME
like ‘%{}%’”.format(k))
a=c.fetchall() if len(a)>=1: for i in a:
print(“Addmissionno:”,i[0]) print(“Name is:”,i[1])
print(“Sex:”,i[2])
print(“Class=”,i[3])
print(“Sec:”,i[4])
print(“Phonenumberis=”,i[5]) print(“Email_id:”,i[6])
print(“Streamis:”,i[7])
print(“-----------------------------------------------“)
else:
print(“StudentDetailsNotFound”) d.commit()
#Todisplaythemarksofstudentsfrom student
details table .
defview_Marks():
print(“*******************VIEWSTUDENT
DETAILS******************”)
K=input(“Enternametoviewstudentdetails: “)
D=con.connect(host=”localhost”,user=”root”,password=”a
dmin”,database=”student_management_system”
)
C=d.cursor()
c.execute(“select*fromSTUDENT_DETAILSwhereNAME
like ‘%{}%’”.format(k))
s=c.fetchall() for i in s:
print(“MARKS:”,i[8])
print(“------------------------------------------------“)
d.commit()
whileTrue:
print(“**************WELCOMETO
STUDENT
MANAGEMENT*****************”)
print(“1.admin”)
print(“2.user”)
print(“3.exit”)
ch=int(input(“loginthrough:“)) if
ch==1:
admin() elifch==2:
user() elifch==3:
break else:
print(“invalidinput”)