Cs Project by Priyansh
Cs Project by Priyansh
Date: Place:
Signature of Signature of
Internal Examiner External Examiner
TABLE OF CONTENTS
1. Project Informa on …………………. 1-4
2. Acknowledgment …………………. 5-6
3. Code …………………. 7-20
4. Outputs ………………. 21-27
5. Bibliography .……………….28
PROJECT
INFORMATION
1.Introduc on
In today's fast-paced world, educa onal
ins tu ons are adop ng digital solu ons to
streamline administra ve tasks, improve
efficiency, and enhance the overall
experience for both students and faculty.
One such essen al system is the Student
Management System (SMS), which serves
as a comprehensive pla orm for managing
student-related informa on. The purpose of
this system is to simplify the process of
storing, retrieving, and managing cri cal
data such as student profiles, grades,
a endance, course registra ons, and
academic history.
A Student Management System provides a
centralized solu on for schools, colleges,
and universi es to track student
performance, monitor a endance, and
facilitate communica on between students
and staff. This project aims to develop an
automated system that addresses the
challenges faced by educa onal ins tu ons
in managing large volumes of student data.
By automa ng these tasks, the system
reduces the administra ve burden,
minimizes human errors, and ensures more
accurate records.
The Student Management System will be
built using a modern web-based interface,
ensuring accessibility and ease of use for
administrators, teachers, and students. Key
features of the system will include student
registra on, course enrollment, grade
management, a endance tracking, and
repor ng. Furthermore, it will allow users to
interact with the pla orm via a secure login
system, ensuring the confiden ality and
privacy of student informa on.
This project seeks to demonstrate how
technology can improve the management of
academic ins tu ons and provide a more
efficient, organized, and user-friendly
approach to student management. By
u lizing advanced programming techniques,
this system will set a founda on for further
enhancements and can be easily adapted to
the needs of any educa onal ins tu on.
2.Methodology/Synopsis
FRONT END: pyhton 3.7
BACK END: MySQL TABLES
USED: I am using a database named
SCHOOL for storing the tables used in my
project and “students” table to store various
data related to the student.
3. Structure of Student Table
def add_record():
try:
c = m.connect(host='localhost',
user='root', password='akshita',
database='school')
cur = c.cursor()
# Get inputs
no = int(input("Enter admission number-
->"))
# Insert data
A = "INSERT INTO students (no, name,
gender, sec on, dob, marks) VALUES (%s, %s,
%s, %s, %s, %s)"
data = (no, name, gen, sec on, dob,
marks)
cur.execute(A, data)
c.commit()
print("\nData added successfully.........")
except m.Error as e:
print(f"\nError: {e}")
except ValueError:
print("\nInvalid input! Please enter valid
data.")
finally:
cur.close()
c.close()
def disp_all():
try:
con = m.connect(host='localhost',
user='root', password='akshita',
database='school')
cur = con.cursor()
cur.execute('SELECT * FROM students')
record = cur.fetchall()
print("Adm
No\tName\tGender\tSec on\tDOB\tMarks"
)
for row in record:
print(f"{row[0]}\t{row[1]}\t{row[2]}\t{row[3
]}\t{row[4]}\t{row[5]}")
except m.Error as e:
print(f"\nError: {e}")
finally:
cur.close()
con.close()
def search_record():
try:
c = m.connect(host='localhost',
user='root', password='akshita',
database='school')
cur = c.cursor()
if choice == '1':
no = int(input("Enter admission
number to search-->"))
cur.execute("SELECT * FROM students
WHERE no = %s", (no,))
record = cur.fetchone()
if record:
print("Record Found: ")
print(f"Adm No: {record[0]}, Name:
{record[1]}, Gender: {record[2]}, Sec on:
{record[3]}, DOB: {record[4]}, Marks:
{record[5]}")
else:
print("Record not found.")
elif choice == '2':
name = input("Enter name to search--
>")
cur.execute("SELECT * FROM students
WHERE name LIKE %s", ('%' + name + '%',))
records = cur.fetchall()
if records:
print("Records Found: ")
for record in records:
print(f"Adm No: {record[0]},
Name: {record[1]}, Gender: {record[2]},
Sec on: {record[3]}, DOB: {record[4]},
Marks: {record[5]}")
else:
print("Record not found.")
else:
print("Invalid choice. Please select 1
or 2.")
except m.Error as e:
print(f"\nError: {e}")
finally:
cur.close()
c.close()
def delete_record():
try:
c = m.connect(host='localhost',
user='root', password='akshita',
database='school')
cur = c.cursor()
if record:
# Proceed to delete
cur.execute("DELETE FROM students
WHERE no = %s", (no,))
c.commit()
print("Record deleted successfully.")
else:
print("Record not found.")
except m.Error as e:
print(f"\nError: {e}")
finally:
cur.close()
c.close()
def update_record():
try:
c = m.connect(host='localhost',
user='root', password='akshita',
database='school')
cur = c.cursor()
if record:
print(f"Current Record: Adm No:
{record[0]}, Name: {record[1]}, Gender:
{record[2]}, Sec on: {record[3]}, DOB:
{record[4]}, Marks: {record[5]}")
# Update record
cur.execute("""
UPDATE students
SET name = %s, gender = %s, sec on
= %s, dob = %s, marks = %s
WHERE no = %s
""", (name, gen, sec on, dob, marks,
no))
c.commit()
print("Record updated successfully.")
else:
print("Record not found.")
except m.Error as e:
print(f"\nError: {e}")
finally:
cur.close()
c.close()
def main_menu():
a = ''' 1. Add Record
2. Display Records
3. Search Record
4. Delete Record
5. Update Record
6. Exit'''
while(1):
print("MAIN MENU")
print("===================")
print(a)
ch = int(input("Enter your choice-->"))
if ch == 1:
add_record()
elif ch == 2:
disp_all()
elif ch == 3:
search_record()
elif ch == 4:
delete_record()
elif ch == 5:
update_record()
elif ch == 6:
print("Exi ng system...")
break
else:
print("Wrong choice, Enter again......")