0% found this document useful (0 votes)
62 views19 pages

Cs Project

Vv

Uploaded by

whatcom91
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)
62 views19 pages

Cs Project

Vv

Uploaded by

whatcom91
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/ 19

UNDERTAKING

We declare that the work presented in this project titled "STUDENT MAMANGEMENT SYSTEM",
submitted to Mr. Akshay Varshney PGT - Computer Science, Army Public School, LBS Marg for the award
of CBSE-AISSCE class XII certificate.

For the support and correctness of our work we have attached a plagiarism report from Grammarly.com which
is an open-source plagiarism checker and it is according to specifications provided by CBSE.

BY:

1. ABHAY CHAUHAN – XII B ROLL NO_________________


2. AKASH YADAV – XII B ROLL NO____________________
3. ANKIT PANDEY – XII BROLL NO____________________

2
CERTIFICATE

It is certified that the work contained in the project titled "STUDENT MANAGEMENT SYSTEM", by
"Abhay Chauhan, Akash Yadav, Ankit Pandey", has been carried out under my supervision and that this was
has not been submitted elsewhere for a AISSCE certificate.

(Mrs. Sadhana Devi)

PRINCIPAL

ARMY PUBLIC SCHOOL LBS MARG

Project Guide:

(Mr. Akshay Varshney)

PGT – COMPUTER SCIENCE

ARMY PUBLIC SCHOOL LBS MARG

External Examiner Sign

___________________

3
ACKNOWLEDGEMENT

We would like to thank Mrs. Sadhana Devi, Principal, Army Public School, LBS Marg Lucknow who gave
us this golden opportunity to do this work and are deeply indebted to our mentor Mr. Akshay Varshney for
project guidance.

We further say thanks to all the members of Army Public School, LBS marg. We also express our deepest
gratitude to our parents and our friends, as project is a bridge between theoretical and practical learning and
with this thinking we worked on the project and made it successful in a given amount of time.

4
CONTENT

1. Introduction

2. System Requirements

3. Coding

4. Outcomes

5. References

5
INTRODUCTION

Project Description
A Student Management System created using MySQL and Python aims to efficiently manage student data,
including enrolment, grades, attendance, generation of transfer certificate and fee receipts and other required
information. The objective is to create a comprehensive system that enables educational institutions to manage
student-related data effectively. The system will provide functionalities for administrators, teachers, and
students to interact with the database, allowing for seamless information retrieval, updates, and monitoring of
student progress.

METHODOLOGY

The project starts with 'Menu based Input' asked from user as-

• PRESS 1: New admission→ In new admission, we admit a student into our institution with given their
name. class, section. Admission Number, Contact, Address, and other details. In the end, a confirmation
message is also indicated if the student is enrolled.
• PRESS 2: Display student's data→ In Display Student's Data, details of all the students are displayed
on the screen in the comma separated format in tuples.
• PRESS 3: Update student's data→ In this, we can update name, class and roll number of a student
withthe help of his admission number.
• PRESS 4: Issue transfer certificate→ In issue transfer certificate, if a student is leaving the institute then
we issue him the transfer certificate, along with this his details are also removed from the records of the
institute.
• PRESS 5: Add students’ marks detail→ In this, all the marks of the student are updated on the software
to hand out the marksheet and display their overall performance. At last, a confirmation message is
indicated if the marks are fully updated.
• PRESS 6: Generate all students’ report card→ In generating all students' report cards, it issues the
mark details and percentage of all the students on the screen.
• PRESS 7: Generate student-wise report card→ If we want to issue mark details individually, then we
can use this to get the mark details along with the percentage.
• PRESS 8: Pay student’s fee→ We update the fee details like the fee for the various categories such as
tuition fee, etc., and the quarter of submission. When the fee is accepted, a confirmation message is
indicated.
• PRESS 9: Generate student-wise fee receipt→ It generates the student-wise fee receipt along with the
fee amount and the quarter of submission.

6
SYSTEM REQUIREMENTS

Minimum System Requirements

Processors: Intel Atom® processor or Intel® Core™ i3 processor.

Disk space: 1 GB.

Operating systems: Windows 7 or later, MACOS, and UBUNTU.

Python Versions: 2.7.X, 3.6.Χ.

Recommended System Requirements

Processors: Intel® Core™ i3 processor 4300M at 2.60 GHz.

Disk space: 2 to 4 GB.

Operating systems: Windows® 10, MACOS, and UBUNTU

Python Versions: 3.X.X or Higher.

Prerequisites before installing MySQL. Connector Python

You need root or administrator privileges to perform the installation process.

Python must be installed on your machine.

Note: MySQL Connector Python requires python to be in the system's PATH. Installation fails if it doesn't
find Python.

On Windows, If Python doesn't exist in the system's path, please manually add the directory containing
python.exe yourself.

7
ROLE OF TEAM MEMBERS

1. Coding : Abhay Chauhan

2. Analysis and Documentation : Akash Yadav

3. Error Rectification and Resource collection : Ankit Pandey

8
CODING

import mysql.connector

from datetime import datetime

import sys

# Function to connect to MySQL server and create the database if it does not exist

def connect_db():

try:

connection = mysql.connector.connect(

host="localhost",

user=input(" ENTER YOUR MYSQL SERVER'S USERNAME: "),

password=input(" ENTER YOUR MYSQL SERVER'S PASSWORD: ")

cursor = connection.cursor()

cursor.execute("CREATE DATABASE IF NOT EXISTS study")

connection.database = "study"

return connection

except mysql.connector.Error as err:

print(f"\nDatabase connection error: {err}")

print("Exiting the program due to incorrect login credentials.")

sys.exit() # Exit the program if the connection fails

# Function to create tables if they don't exist

def setup_tables(conn):

with conn.cursor() as cursor:

cursor.execute("""

CREATE TABLE IF NOT EXISTS students (

9
ID INT PRIMARY KEY AUTO_INCREMENT,

name VARCHAR(50),

fname varchar(60),

mname varchar(60),

contact_no int(10),

emergency_no int(10),

age INT,

class VARCHAR(10),

grade VARCHAR(5),

transferred BOOLEAN DEFAULT FALSE

""")

cursor.execute("""

CREATE TABLE IF NOT EXISTS results (

student_id INT,

subject VARCHAR(50),

marks INT,

FOREIGN KEY (student_id) REFERENCES students(ID) ON DELETE CASCADE

)""")

cursor.execute("""

CREATE TABLE IF NOT EXISTS fees (

student_id INT,

amount DECIMAL(10, 2),

payment_date DATE,

FOREIGN KEY (student_id) REFERENCES students(ID) ON DELETE CASCADE

)""")

conn.commit()

# Function to prompt for continuation

def continue_prompt(action_description):
10
while True:

choice = input(f"\nWould you like to {action_description} another entry (Y/N)? ").strip().lower()

if choice == 'y':

return True

elif choice == 'n':

return False

else:

print("Invalid choice.\n\nPlease enter 'Y' for Yes or 'N' for No.")

# Function to add a new admission

def add_student(conn):

with conn.cursor() as cursor:

print("\nAdding a new student record.")

name = input("Enter student's name: ")

fname=input("Enter Father's name:")

mname=input("Enter Mother's name:")

contact=int(input("Enter your contact no:"))

emergency_no=int(input("Enter emergency contact no:"))

age = int(input("Enter age of the student: "))

student_class = input("Enter student's class (e.g., 10A): ")

grade = input("Enter student's grade (e.g., A, B+): ")

cursor.execute("INSERT INTO students (name, fname, mname, contact_no, emergency_no, age, class,
grade) VALUES (%s, %s, %s, %s,%s, %s, %s, %s)",

(name, fname, mname, contact, emergency_no, age, student_class, grade))

conn.commit()

print("New admission added successfully.")

if not continue_prompt("add"):

return

# Function to view student details

def view_student_details(conn):

11
with conn.cursor() as cursor:

while True:

choice = input("\nView details of (1) All students or (2) Specific student? Enter 1 or 2: ")

if choice == '1':

cursor.execute("SELECT ID, name, fname, mname, contact_no, emergency_no, age, class, grade
FROM students WHERE transferred = FALSE")

results = cursor.fetchall()

if results:

print("\nAll active student records:")

for (ID, name, fname, mname, contact_no, emergency_no, age, student_class, grade) in results:

print(f"ID: {ID},\nName: {name},\nFather's Name: {fname},\nMother's Name: {mname},"

f"\nContact no: {contact_no},\nEmergency No: {emergency_no},"

f"\nAge: {age},\nClass: {student_class},\nGrade: {grade}\n")

else:

print("No active records found.")

elif choice == '2':

student_id = int(input("Enter student ID: "))

cursor.execute("SELECT ID, name, fname, mname, contact_no, emergency_no, age, class, grade
FROM students WHERE ID = %s AND transferred = FALSE", (student_id,))

result = cursor.fetchone()

if result:

(ID, name, fname, mname, contact_no, emergency_no, age, student_class, grade) = result

print(f"ID: {ID},\nName: {name},\nFather's Name: {fname},\nMother's Name: {mname},"

f"\nContact no: {contact_no},\nEmergency No: {emergency_no},"

f"\nAge: {age},\nClass: {student_class},\nGrade: {grade}\n")

else:

print("No active record found for the given ID.")

else:

print("Invalid choice, please try again.")

12
continue

if not continue_prompt("view"):

break

# Function to update a student's record

def update_student_record(conn):

while True:

with conn.cursor() as cursor:

student_id = int(input("\nEnter student ID to update: "))

name = input("Enter new name: ")

fname=input("Enter the father's name that is to be updated: ") #this syntax only because "enter new
father's name" would look a bit inappropriate

mname=input("Enter the mother's name that is to be updated: ") #this syntax only as "enter new
mother's name" would look a bit inappropriate

contact_no=int(input("Enter the new Contact no: "))

emergency_no=int(input("Enter the new emergency no: "))

age = int(input("Enter new age: "))

student_class = input("Enter new class (e.g., 10A): ")

grade = input("Enter new grade (e.g., A, B+): ")

cursor.execute("UPDATE students SET name=%s, fname=%s, mname=%s, contact_no=%s,


emergency_no=%s, age=%s, class=%s, grade=%s WHERE ID=%s",

(name, fname, mname, contact_no, emergency_no, age, student_class, grade, student_id))

conn.commit()

if cursor.rowcount > 0:

print("Student record updated successfully.")

else:

print("No student found with that ID.")

if not continue_prompt("update"):

break

# Function to issue a transfer certificate

def transfer_certificate(conn):
13
while True:

with conn.cursor() as cursor:

student_id = int(input("\nEnter student ID to issue transfer certificate: "))

cursor.execute("UPDATE students SET transferred = TRUE WHERE ID = %s", (student_id,))

conn.commit()

if cursor.rowcount > 0:

# Fetch and display the student's details

cursor.execute("SELECT * FROM students WHERE ID = %s", (student_id,))

student_details = cursor.fetchone()

if student_details:

print("\nTransfer certificate issued successfully for the following student:")

print(f"ID: {student_details[0]}, Name: {student_details[1]},Father's name:


{student_details[3]}, Mother's name: {student_details[4]}, Age: {student_details[7]}, Class:
{student_details[8]}, Grade: {student_details[9]}")

else:

print("No student found with that ID.")

if not continue_prompt("issue another transfer certificate for"):

break

# Function to update or add a new result for a student

def update_or_add_result(conn):

while True:

with conn.cursor() as cursor:

student_id = int(input("\nEnter student ID: "))

# Fetch current subjects and marks for the student

cursor.execute("SELECT subject, marks FROM results WHERE student_id = %s", (student_id,))

existing_results = cursor.fetchall()

# Display existing results if available

if existing_results:

print(f"\nCurrent results for Student ID {student_id}:")

14
for (subject, marks) in existing_results:

print(f"Subject: {subject}, Marks: {marks}")

else:

print(f"No previous results found for Student ID {student_id}.")

# Prompt for the subject

subject = input("\nEnter subject: ")

marks = int(input("Enter marks: "))

# Check if the subject already exists

cursor.execute("SELECT marks FROM results WHERE student_id = %s AND subject = %s",


(student_id, subject))

existing_subject = cursor.fetchone()

# Prompt for action if the subject exists

if existing_subject:

print(f"\nSubject '{subject}' already exists with marks: {existing_subject[0]}")

action_choice = input("Press (1) to Update existing marks or (2) to Add a new record for this
subject: ").strip()

if action_choice == '1':

# Update the existing record

cursor.execute("UPDATE results SET marks = %s WHERE student_id = %s AND subject =


%s",

(marks, student_id, subject))

conn.commit()

print(f"Marks updated successfully for {subject}. New marks: {marks}.")

elif action_choice == '2':

# Add a new record with the same subject name

cursor.execute("INSERT INTO results (student_id, subject, marks) VALUES (%s, %s, %s)",

(student_id, subject, marks))

conn.commit()
15
print(f"New record added for {subject} with marks: {marks}.")

else:

print("Invalid choice. Please enter 1 or 2 next time.")

else:

# Insert a new result if the subject does not exist

cursor.execute("INSERT INTO results (student_id, subject, marks) VALUES (%s, %s, %s)",

(student_id, subject, marks))

conn.commit()

print(f"New result added: {subject} - {marks}.")

# Prompt to continue or stop

if not continue_prompt("update or add another result"):

break

# Function to generate results for a student or all students

def generate_result(conn):

with conn.cursor() as cursor:

while True:

choice = input("\nGenerate result for (1) All students or (2) Specific student? Enter 1 or 2: ")

if choice == '1':

cursor.execute("SELECT student_id, subject, marks FROM results")

print("\nResults for all students:")

for (student_id, subject, marks) in cursor.fetchall():

print(f"Student ID: {student_id}, Subject: {subject}, Marks: {marks}")

elif choice == '2':

student_id = int(input("Enter student ID: "))

cursor.execute("SELECT subject, marks FROM results WHERE student_id = %s", (student_id,))

print(f"\nResults for Student ID {student_id}:")

for (subject, marks) in cursor.fetchall():

print(f"Subject: {subject}, Marks: {marks}")


16
else:

print("Invalid choice, please try again.")

continue

if not continue_prompt("generate"):

break

# Function to record a fee payment

def fee_payment(conn):

while True:

with conn.cursor() as cursor:

student_id = int(input("\nEnter student ID: "))

amount = float(input("Enter amount: "))

payment_date = datetime.now().date()

cursor.execute("INSERT INTO fees (student_id, amount, payment_date) VALUES (%s, %s, %s)",

(student_id, amount, payment_date))

conn.commit()

print("Fee payment recorded successfully.")

if not continue_prompt("record another fee payment for"):

break

# Function to generate fee receipts

def generate_fee_receipt(conn):

with conn.cursor() as cursor:

while True:

choice = input("\nGenerate fee receipt for (1) All students or (2) Specific student? Enter 1 or 2: ")

if choice == '1':

cursor.execute("SELECT student_id, amount, payment_date FROM fees")


17
print("\nFee receipts for all students:")

for (student_id, amount, payment_date) in cursor.fetchall():

print(f"Student ID: {student_id}, Amount: {amount}, Payment Date: {payment_date}")

elif choice == '2':

student_id = int(input("Enter student ID: "))

cursor.execute("SELECT amount, payment_date FROM fees WHERE student_id = %s",


(student_id,))

print(f"\nFee receipts for Student ID {student_id}:")

for (amount, payment_date) in cursor.fetchall():

print(f"Amount: {amount}, Payment Date: {payment_date}")

else:

print("Invalid choice, please try again.")

continue

if not continue_prompt("generate"):

break

# Main Screen

print("###################################################################")

print("\n |--------------------SESSION 2024 - 2025----------------------|")

print("\n | WELCOME |")

print("\n | TO |")

print("\n | ARMY PUBLIC SCHOOL LAL BAHADUR SHASTRI MARG |")

print('\n | "LUCKNOW" |')

print("\n |-------------------------------------------------------------|")

print("\n | STUDENT_MANAGEMENT |")

print("\n |-------------------------------------------------------------|")

print("###################################################################")

18
# Main function to drive the program

def main():

conn = connect_db()

setup_tables(conn)

while True:

print("CONNECTION ESTABLISHED SUCCESSFULLY!!")

print("|----------------------------------------------------------|")

print("| PRESS 1 - NEW ADMISSION |")

print("| PRESS 2 - STUDENT DETAILS |")

print("| PRESS 3 - UPDATE STUDENT RECORD |")

print("| PRESS 4 - GENERATE TRANSFER CERTIFICATE |")

print("| PRESS 5 - UPDATE OR ADD RESULT |")

print("| PRESS 6 - GENERATE RESULT |")

print("| PRESS 7 - FEE PAYMENT |")

print("| PRESS 8 - GENERATE FEE RECEIPT |")

print("| PRESS 9 - EXIT CONSOLE |")

print("|----------------------------------------------------------|")

choice = input("PLEASE ENTER YOUR CHOICE: ")

if choice == '1':

add_student(conn)

elif choice == '2':

view_student_details(conn)

elif choice == '3':

update_student_record(conn)

elif choice == '4':

transfer_certificate(conn)

elif choice == '5':

update_or_add_result(conn)

elif choice == '6':


19
generate_result(conn)

elif choice == '7':

fee_payment(conn)

elif choice == '8':

generate_fee_receipt(conn)

elif choice == '9':

print("Exiting the program.")

break

else:

print("Invalid choice! Please try again.")

conn.close()

if __name__ == "__main__":

main()

20

You might also like