0% found this document useful (0 votes)
16 views30 pages

Cs Project by Priyansh

The document certifies that Priyansh Nagar completed a project on the Student Management System as part of the CBSE Class XII curriculum. The project aims to automate the management of student data, including registration, attendance, and grades, using Python and MySQL. It includes sections on project information, methodology, code, outputs, and bibliography.
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)
16 views30 pages

Cs Project by Priyansh

The document certifies that Priyansh Nagar completed a project on the Student Management System as part of the CBSE Class XII curriculum. The project aims to automate the management of student data, including registration, attendance, and grades, using Python and MySQL. It includes sections on project information, methodology, code, outputs, and bibliography.
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/ 30

CERTIFICATE

This is to cer fy that Priyansh Nagar has


successfully completed the project file on
Student Management System under my
guidance and supervision. I am sa sfied with
their ini a ve and efforts for the comple on
of project file as a part of curriculum of CBSE
Class XII Examina on.

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

4.Opera ons included in the Project


✓ Add New Record
✓ Display
✓ Search for a record
✓ Update Record
✓ Delete Record
✓ Graphical Representa on of Data.
ACKNOWLEDGMENT
I am sincerely grateful to everyone who
supported me in the successful comple on
of this project. First, I would like to thank my
parents for their constant encouragement
and unwavering support, which mo vated
me to give my best effort throughout this
journey. I extend my hear elt thanks to my
school for providing a pla orm to explore
and apply my technical skills. I am especially
thankful to Ms. Mukta Amba, my computer
teacher, for her invaluable guidance,
mentorship, and pa ence. Her insights and
feedback were pivotal in shaping this project.
I would also like to express my gra tude to
my project partners, Divyesh Jethani and
Akshita Arora, for their collabora on, ideas,
and dedica on. Working together on this
project has been a truly enriching
experience, and his contribu ons have been
invaluable to its success. Lastly, I am grateful
for the opportunity to undertake this project
as part of my senior school computer
examina on, as it has been a significant
learning experience and a rewarding
challenge.
CODE
import mysql.connector as m

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-
->"))

# Check if the admission number already


exists
cur.execute("SELECT * FROM students
WHERE no = %s", (no,))
if cur.fetchone():
print("\nAdmission number already
exists!")
return

name = input("Enter student name-->")


gen = input("Enter student gender-->")
sec on = input("Enter sec on-->")
dob = input("Enter date of birth-->")
marks = int(input("Enter marks-->"))

# 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()

# Ask the user how to search (by


admission number or name)
choice = input("Search by: 1. Admission
Number 2. Name: ")

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()

# Get admission number of the student


to delete
no = int(input("Enter admission number
to delete the record-->"))

# Check if the record exists


cur.execute("SELECT * FROM students
WHERE no = %s", (no,))
record = cur.fetchone()

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()

# Get admission number of the student


to update
no = int(input("Enter admission number
to update the record-->"))

# Check if the record exists


cur.execute("SELECT * FROM students
WHERE no = %s", (no,))
record = cur.fetchone()

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]}")

# Get new details to update


name = input("Enter new name (Leave
blank to keep current): ") or record[1]
gen = input("Enter new gender (Leave
blank to keep current): ") or record[2]
sec on = input("Enter new sec on
(Leave blank to keep current): ") or record[3]
dob = input("Enter new date of birth
(Leave blank to keep current): ") or record[4]
marks = input("Enter new marks
(Leave blank to keep current): ") or 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......")

# Run the main menu


main_menu()
OUTPUT
BIBLIOGRAPHY
→ Computer Science by Sumita Arora For
Class XI And XII.
→ Computer Science For Class XI by NCERT.
→ Computer Science For Class XII by NCERT.
→ www.geeksforgeeks.org

You might also like