0% found this document useful (0 votes)
25 views18 pages

Vinaycs

Uploaded by

ZoldycKe
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)
25 views18 pages

Vinaycs

Uploaded by

ZoldycKe
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/ 18

CERTIFICATE

This is to certify that Vinay Mishra, student of


class 12 has successfully completed the research on
th

the project, School Management Systems under the


guidance of Mrs. Amoli Chakraborty during the year
of 2024-2025 in partial fulfillment of computer
science practical examination conducted by Bedi
International School, Bareilly.

Examiner Signature Principal Signature


________________ _________________

1
ACKNOWLEDGEMENT

We owe our heartfelt gratitude to everyone who


supported us in successfully completing this
project.

First and foremost, we thank God for giving us the


strength, wisdom, and determination to accomplish
this task. We are deeply grateful to our principal,
Mrs. JK Sawhney, and our Computer Science teacher,
Mrs. Amoli Chakraborty, for their invaluable
guidance and encouragement, which shaped this
project and ensured its success.

We also extend our thanks to our parents, whose


constant support and advice guided us through every
challenge we faced during this journey.

Lastly, we sincerely thank all those who


contributed, directly or indirectly, to making this
project a reality. Your support means the world to
us.

2
INTRODUCTION

The project “School Management System” was


assigned to test our knowledge of Computer Science
and provide hands-on experience with real-world
challenges in software development. This approach,
introduced by the Central Board of Secondary
Education (CBSE), emphasizes practical learning by
exposing students to realistic scenarios.

The main objectives of this project are:

• To create a database management system using


MySQL to manage organizational records
efficiently.
• To develop programs for maintaining student
details, fee records, and admission processes.

This project aims to enhance our understanding of


database systems and their application in solving
real-world problems.

3
PROGRAM CODE

import mysql.connector as co

def create_tables():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()

create_admission_table = """
CREATE TABLE IF NOT EXISTS Admission (
adno VARCHAR(20) PRIMARY KEY,
rno VARCHAR(20),
sname VARCHAR(100),
address TEXT,
phon VARCHAR(15),
clas VARCHAR(10)
);
"""
cursor.execute(create_admission_table)
print("Admission table created successfully.")

create_student_table = """
CREATE TABLE IF NOT EXISTS Student (
session VARCHAR(20),
stname VARCHAR(100),
stclass VARCHAR(10),
stsec VARCHAR(5),
stroll VARCHAR(20) PRIMARY KEY,
sub1 VARCHAR(100),
sub2 VARCHAR(100),
sub3 VARCHAR(100)
);
"""
cursor.execute(create_student_table)
print("Student table created successfully.")

create_fee_table = """
CREATE TABLE IF NOT EXISTS Fees (
adno VARCHAR(20),
FeeDeposit INT,
Month VARCHAR(20),
PRIMARY KEY(adno, Month),
FOREIGN KEY(adno) REFERENCES Admission(adno) ON DELETE CASCADE
);
"""
cursor.execute(create_fee_table)
print("Fee table created successfully.")

mycon.commit()
except Exception as e:

4
print(f"Error creating tables: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def main_menu():
while True:
print(".............................................")
print("***** SCHOOL MANAGEMENT SYSTEM *****")
print(".............................................")
print("\n***** BEDI INTERNATIONAL SCHOOL*****")
print("1. Admission")
print("2. Student Data")
print("3. Fee Details")
print("4. Exit")
print(".............................................")
print("---------------------------------------------")

try:
choice = int(input("Enter your choice: "))
if choice == 1:
admission_menu()
elif choice == 2:
student_data_menu()
elif choice == 3:
fee_details_menu()
elif choice == 4:
print("Exiting... Thank you!")
break
else:
print("Error: Invalid choice. Try again.")
except ValueError:
print("Error: Please enter a valid number.")
input("Press Enter to continue...")

def admission_menu():
while True:
print(" .........................................")
print("*****SCHOOL-MANAGEMENT-SYSTEM*****")
print("..........................................")
print("\n**Admission**\n")
print("1. Add New Admission Details")
print("2. Show Admission Details")
print("3. Search Admission Record")
print("4. Delete Record")
print("5. Update Admission Details")
print("6. Return")
print("--------------------------------------------")

try:
choice = int(input("Enter your choice: "))
if choice == 1:
admin_details()
elif choice == 2:
show_admin_details()
elif choice == 3:
search_admin_details()
elif choice == 4:
delete_admin_details()

5
elif choice == 5:
edit_admin_details()
elif choice == 6:
return
else:
print("Error: Invalid choice. Try again.")
except ValueError:
print("Error: Please enter a valid number.")
input("Press Enter to continue...")

def admin_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission No.: ")
rno = input("Enter Roll No.: ")
sname = input("Enter Student Name: ")
address = input("Enter Address: ")
phon = input("Enter Mobile No.: ")
clas = input("Enter Class: ")
query = ("INSERT INTO Admission (adno, rno, sname, address, phon,
clas) "
"VALUES (%s, %s, %s, %s, %s, %s)")
cursor.execute(query, (adno, rno, sname, address, phon, clas))
mycon.commit()
print("Record has been saved successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def show_admin_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
cursor.execute("SELECT * FROM Admission")
data = cursor.fetchall()
for row in data:
print(row)
except Exception as e:
print(f"Error: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def search_admin_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adn = input("Enter Admission Number: ")
st = "SELECT * FROM Admission WHERE adno=%s"
cursor.execute(st, (adn,))
data = cursor.fetchall()

6
for row in data:
print(row)
except Exception as e:
print(f"Error: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def delete_admin_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adn = input("Enter Admission Number: ")
st = "DELETE FROM Admission WHERE adno=%s"
cursor.execute(st, (adn,))
mycon.commit()
print("Record has been deleted successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def edit_admin_details():
while True:
print("1. Edit Name")
print("2. Edit Address")
print("3. Edit Phone Number")
print("4. Return")
print("-----------------------------------------")
try:
choice = int(input("Enter your choice: "))
if choice == 1:
edit_name()
elif choice == 2:
edit_address()
elif choice == 3:
edit_phno()
elif choice == 4:
return
else:
print("Error: Invalid choice. Try again.")
except ValueError:
print("Error: Please enter a valid number.")

def edit_name():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission No.: ")
name = input("Enter Correct Name: ")
st = "UPDATE Admission SET sname=%s WHERE adno=%s"
cursor.execute(st, (name, adno))
mycon.commit()
print("Name updated successfully.")

7
except Exception as e:
print(f"Error: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def edit_address():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission No.: ")
address = input("Enter Correct Address: ")
st = "UPDATE Admission SET address=%s WHERE adno=%s"
cursor.execute(st, (address, adno))
mycon.commit()
print("Address updated successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def edit_phno():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission No.: ")
phone = input("Enter Correct Phone Number: ")
st = "UPDATE Admission SET phon=%s WHERE adno=%s"
cursor.execute(st, (phone, adno))
mycon.commit()
print("Phone number updated successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
if cursor:
cursor.close()
if mycon:
mycon.close()

def student_data_menu():
while True:
print(".........................................")
print("***** SCHOOL MANAGEMENT SYSTEM *****")
print(".........................................")
print("\n************ STUDENT DATA ************")
print("1. Add Student Record")
print("2. Show Student Records")
print("3. Search Student Record")
print("4. Delete Record")
print("5. Update Student Record")
print("6. Return")
print("-----------------------------------------")

try:

8
choice = int(input("Enter your choice: "))
if choice == 1:
add_record()
elif choice == 2:
show_stu_details()
elif choice == 3:
search_stu_details()
elif choice == 4:
delete_stu_details()
elif choice == 5:
edit_stu_details()
elif choice == 6:
return
else:
print("Error: Invalid choice. Try again.")
except ValueError:
print("Error: Please enter a valid number.")
input("Press Enter to continue...")

def add_record():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
session = input("Enter Session: ")
stname = input("Enter Student Name: ")
stclass = input("Enter Class: ")
stsec = input("Enter Section: ")
stroll = input("Enter Roll No.: ")
subjects = [input(f"Enter Subject {i + 1}: ") for i in range(3)]

query = (
"INSERT INTO Student (session, stname, stclass, stsec, stroll,
sub1, sub2, sub3) "
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s)"
)
values = (session, stname, stclass, stsec, stroll, *subjects)
cursor.execute(query, values)
mycon.commit()
print("Record has been saved in the Student table.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def show_stu_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
cursor.execute("SELECT * FROM Student")
data = cursor.fetchall()
for row in data:
print(row)
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

9
def search_stu_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
query = "SELECT * FROM Student WHERE stroll=%s"
cursor.execute(query, (stroll,))
data = cursor.fetchall()
for row in data:
print(row)
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def delete_stu_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
query = "DELETE FROM Student WHERE stroll=%s"
cursor.execute(query, (stroll,))
mycon.commit()
print("Record has been deleted successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def edit_stu_details():
while True:
print("1. Edit Name")
print("2. Edit First Subject")
print("3. Edit Second Subject")
print("4. Edit Third Subject")
print("5. Return")
print("-----------------------------------------")
try:
choice = int(input("Enter your choice: "))
if choice == 1:
edit_name_stu()
elif choice == 2:
edit_sub1()
elif choice == 3:
edit_sub2()
elif choice == 4:
edit_sub3()
elif choice == 5:
return
else:
print("Error: Invalid choice. Try again.")
except ValueError:
print("Error: Please enter a valid number.")

def edit_name_stu():
try:

10
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
name = input("Enter Correct Name: ")
query = "UPDATE Student SET stname=%s WHERE stroll=%s"
cursor.execute(query, (name, stroll))
mycon.commit()
print("Name updated successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def edit_sub1():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
sub1 = input("Enter Correct First Subject: ")
query = "UPDATE Student SET sub1=%s WHERE stroll=%s"
cursor.execute(query, (sub1, stroll))
mycon.commit()
print("First subject updated successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def edit_sub2():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
sub2 = input("Enter Correct Second Subject: ")
query = "UPDATE Student SET sub2=%s WHERE stroll=%s"
cursor.execute(query, (sub2, stroll))
mycon.commit()
print("Second subject updated successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def edit_sub3():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
sub3 = input("Enter Correct Third Subject: ")
query = "UPDATE Student SET sub3=%s WHERE stroll=%s"
cursor.execute(query, (sub3, stroll))
mycon.commit()
print("Third subject updated successfully.")
except Exception as e:

11
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def fee_details_menu():
while True:
print(".............................................")
print("***** SCHOOL MANAGEMENT SYSTEM *****")
print(".............................................")
print("\n************ FEE DETAILS ************")
print("1. Add Fee Deposit")
print("2. Show Fee Details")
print("3. Search Fee Details")
print("4. Delete Fee Record")
print("5. Return")
print("---------------------------------------------")

try:
choice = int(input("Enter your choice: "))
if choice == 1:
fee_deposit()
elif choice == 2:
show_fee_details()
elif choice == 3:
search_fee_details()
elif choice == 4:
delete_fee_details()
elif choice == 5:
return
else:
print("Error: Invalid choice. Try again.")
except ValueError:
print("Error: Please enter a valid number.")
input("Press Enter to continue...")

def fee_deposit():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission No.: ")
fee = int(input("Enter Fee Amount: "))
month = input("Enter Month: ")
query = "INSERT INTO Fees (adno, FeeDeposit, Month) VALUES (%s, %s,
%s)"
cursor.execute(query, (adno, fee, month))
mycon.commit()
print("Fee deposit record has been saved successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def show_fee_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
cursor.execute("SELECT * FROM Fees")

12
data = cursor.fetchall()
for row in data:
print(row)
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def search_fee_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission Number: ")
query = "SELECT * FROM Fees WHERE adno=%s"
cursor.execute(query, (adno,))
data = cursor.fetchall()
for row in data:
print(row)
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def delete_fee_details():
try:
mycon = co.connect(host="localhost", user="root", passwd="12345",
database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission No.: ")
month = input("Enter Month: ")
query = "DELETE FROM Fees WHERE adno=%s AND Month=%s"
cursor.execute(query, (adno, month))
mycon.commit()
print("Fee record has been deleted successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

create_tables()
main_menu()

13
OUTPUTS

14
15
16
TABLES USED

*Admission Table,

*Student Table,

*Fees Table,

17
CONCLUSION

The School Management System project automates and


streamlines key administration tasks within a
school, including admissions records, student
records, and fee records.

It centralizes data storage in a MySQL database,


ensuring real-time updates and efficient retrieval
of information. The system simplifies tasks like
student registration, fee deposits, and record
management, reducing manual effort and human error.

It also offers features like fee tracking by month,


record updating, and easy data access. While the
system is functional, future enhancements like a
web interface, advanced reporting, and automated
notifications could further improve its usability
and efficiency for school administrators.

18

You might also like