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

Cs. Investigatory Project

Uploaded by

aniketu2722
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 views20 pages

Cs. Investigatory Project

Uploaded by

aniketu2722
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/ 20

PM SHRI KENDRIYA VIDYALAYA

NO-2 JHANSI CANTT

COMPUTER SCIENCE INVESTIGATORY PROJECT


SESSION-2024-2025
Student Management System
SUBMITTED BY :---
NAME :- ANIKETUPADHYAY
CLASS :- XII-A
ROLL NO :- 17
SUBMITTED TO:---
SHRI DEEPAK TRIPATHI PGT (C.S)
CERTIFICATE
This is to certify that ANIKET UPADHYAY of class:
XII A of PM SHRI KENDRIYA VIDYALAYA NO 2
JHANSI has done his project on STUDENT
MANAGEMENT SYSTEM under my supervision. He
has taken interest and has shown at most sincerity
in completion of this project. I certify this project
up to my expectation & as per guidelines issued by
CBSE, NEW DELHI.

INTERNAL EXAMINER EXTERNAL EXAMINER

PRINCIPLE
ACKNOWLEDGMENT
It is with pleasure that I acknowledge my sincere
gratitude to our teacher, MR. DEEPAK
TRIPATHI who taught and undertook the
responsibility of teaching the subject computer
science. I have been greatly benefited from his
classes. I am especially indebted to our Principal
MS. RADHA GUPTA who has always been a
source of encouragement and support and
without whose inspiration this project would not
have been a successful I would like to place on
record heartfelt thanks to him. Finally, I would like
to express my sincere appreciation for all the other
students for my batch their friendship & the fine
time that we all shared together.
Introduction
The Student Management System is designed to
streamline and automate the management of
student data within an educational institution. The
system allows for easy and efficient data storage,
retrieval, and modification using Python and MySQL
connectivity. By replacing manual record-keeping
systems, this software improves data accuracy,
accessibility, and overall efficiency in managing
student-related information.
Objectives of the Project
The primary objectives of this Student Management System
are:
1. To design a system for securely storing and managing
student information such as name, roll number, class,
marks, and attendance.
2. To enable the easy addition, updating, deletion, and
retrieval of student records.
3. To ensure that data manipulation can be performed
efficiently using a Python-MySQL connected system.
4. To reduce manual paperwork and improve the speed
and accuracy of data handling.
Proposed System
The proposed system will involve:
• A MySQL database that stores the student
information.
• A Python-based interface that allows users
to interact with the database.
• Basic CRUD (Create, Read, Update, Delete)
operations for managing student data.
• A menu-driven interface for user interaction.
The system is simple, user-friendly, and
scalable. It uses Python's mysql-connector
library for database connectivity and ensures
efficient data storage and retrieval
Flow Chart
The flow chart below explains the basic operation of the Student Management
System:

sql
+---------------------+
| Start Program |
+---------------------+
|
v
+---------------------+
| Display Menu |
+---------------------+
|
v
+-----------------------------+
| User Selects an Option |
+-----------------------------+
| | | |
v v v v
+----------+ +---------+ +---------+ +----------+
| Add | | View | | Update | | Delete |
| Student | | Students| | Marks | | Student |
+----------+ +---------+ +---------+ +----------+
| | | |
v v v v
+-------------------------------+
| Execute Selected Operation |
+-------------------------------+
|
v
+---------------------+
| End Program |
+---------------------+

Source Code
MySQL Table Setup:
Before running the Python code, create the necessary
database and table in MySQL:
Source Code
MySQL Table Setup:
Before running the Python code, create the necessary
database and table in MySQL:
sql
CREATE DATABASE student_management;

USE student_management;

CREATE TABLE students (


id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
roll_number INT UNIQUE,
class VARCHAR(10),
marks FLOAT,
attendance_percentage FLOAT);
PYTHON
import mysql.connector
from prettytable import PrettyTable

# Connect to MySQL
conn = mysql.connector.connect(
host="localhost",
user="root", # replace with your MySQL username
password="yourpassword", # replace with your MySQL password
database="student_management"
)

cursor = conn.cursor()

# Function to add a new student


def add_student():
name = input("Enter student name: ")
roll_number = int(input("Enter roll number: "))
class_name = input("Enter class: ")
marks = float(input("Enter marks: "))
attendance = float(input("Enter attendance percentage: "))

sql = "INSERT INTO students (name, roll_number, class, marks,


attendance_percentage) VALUES (%s, %s, %s, %s, %s)"
val = (name, roll_number, class_name, marks, attendance)
cursor.execute(sql, val)
conn.commit()
print("Student added successfully!\n")

# Function to display all students


def display_students():
cursor.execute("SELECT * FROM students")
result = cursor.fetchall()

table = PrettyTable(['ID', 'Name', 'Roll Number', 'Class', 'Marks', 'Attendance


(%)'])
for row in result:
table.add_row(row)

print(table)
print()

# Function to update a student's marks


def update_student():
roll_number = int(input("Enter roll number of student to update: "))
new_marks = float(input("Enter new marks: "))

sql = "UPDATE students SET marks = %s WHERE roll_number = %s"


val = (new_marks, roll_number)
cursor.execute(sql, val)
conn.commit()
print("Marks updated successfully!\n")

# Function to delete a student record


def delete_student():
roll_number = int(input("Enter roll number of student to delete: "))

sql = "DELETE FROM students WHERE roll_number = %s"


val = (roll_number,)
cursor.execute(sql, val)
conn.commit()
print("Student deleted successfully!\n")

# Menu-driven interface
def menu():
while True:
print("----- Student Management System -----")
print("1. Add Student")
print("2. View All Students")
print("3. Update Student Marks")
print("4. Delete Student")
print("5. Exit")
choice = input("Enter your choice: ")

if choice == '1':
add_student()
elif choice == '2':
display_students()
elif choice == '3':
update_student()
elif choice == '4':
delete_student()
elif choice == '5':
break
else:
print("Invalid choice, please try again!\n")

# Run the menu


menu()

# Close the connection


cursor.close()
conn.close()
Output
Example output when running the system:
Menu Display:
SQL
----- Student Management System -----
Add Student
View All Students
Update Student Marks
Delete Student
Exit
Enter your choice: 1
Add a Student:
Mathematica
Enter student name: John Doe
Enter roll number: 101
Enter class: 10A
Enter marks: 85.5
Enter attendance percentage: 90
Student added successfully!
View All Students:
+----+-----------+-------------+-------+-------+-------------------+
| ID | Name | Roll Number | Class | Marks | Attendance (%) |
+----+-----------+-------------+-------+-------+-------------------+
| 1 | John Doe | 101 | 10A | 85.5 | 90.0 |
+----+-----------+-------------+-------+-------+-------------------+

Update Marks:
Enter roll number of student to update: 101
Enter new marks: 90
Marks updated successfully!
Delete a Student:
Enter roll number of student to delete: 101
Student deleted successfully!
Hardware and Software
Requirements

Hardware Requirements:
¥ Processor: Intel i3 or higher
¥ RAM: 4 GB or more
¥ Hard Disk Space: 500 MB for project files
¥ Monitor: Standard display
Software Requirements:
Software Requirements:
¥ Operating System: Windows, Linux, or macOS
¥ Python Version: 3.6 or higher
¥ MySQL Version: 5.7 or higher
¥ Python Libraries:
☺ mysql-connector-python for MySQL
connectivity

☺ prettytable for formatted display of data

NOT THIS!
Bibliography
The following resources were used in the
development of this project:
€ Python Official Documentation-- https://docs.python.org/3/
€ MySQL Documentation-- https://dev.mysql.com/d/oc
€T utorials on Python-MySQL connectivity from various online sources
like StackOverflow, GeeksforGeeks, and W3Schools.
THANK
YOU!!

You might also like