0% found this document useful (0 votes)
11 views

cs

Uploaded by

ZoldycKe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

cs

Uploaded by

ZoldycKe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

CERTIFICATE

This is to certify that Raghav Singh, student of


class 12th has successfully completed the research
on 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
# main_Menu.py
import main_menu
import admission
import student_data
import fee_details

while True:
print("\t\t.............................................")
print("\t\t***** SCHOOL MANAGEMENT SYSTEM *****")
print("\t\t.............................................")
print("\n\t\t***** BEDI INTERNATIONAL SCHOOL*****")
print("\t\t1. Admission")
print("\t\t2. Student Data")
print("\t\t3. Fee Details")
print("\t\t4. Exit")
print("\t\t.............................................")
print("\t\t---------------------------------------------")

# Get user choice


try:
choice = int(input("Enter your choice: "))
if choice == 1:
admission.adm_menu()
elif choice == 2:
student_data.stu_menu()
elif choice == 3:
fee_details.fee_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...")

4
# admission.py
import main_menu
import mysql.connector as co

def adm_menu():
while True:
print("\t\t.........................................")
print("\t\t*****SCHOOL-MANAGEMENT-SYSTEM*****")
print("\t\t..........................................")
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("\t\t--------------------------------------------")

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()
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="root", 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: ")

5
query = ("INSERT INTO Admission (adno, rno, sname,
address, phon, clas) "
"VALUES ('{}', '{}', '{}', '{}', '{}',
'{}')").format(adno, rno, sname, address, phon, clas)
cursor.execute(query)
mycon.commit()
print("Record has been saved successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

def show_admin_details():
try:
mycon = co.connect(host="localhost", user="root",
passwd="root", 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:
cursor.close()
mycon.close()

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

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

6
adn = input("Enter Admission Number: ")
st = f"DELETE FROM Admission WHERE adno='{adn}'"
cursor.execute(st)
mycon.commit()
print("Record has been deleted successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
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("\t\t-----------------------------------------")
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="root", database="MPS")
cursor = mycon.cursor()
adno = input("Enter Admission No.: ")
name = input("Enter Correct Name: ")
st = f"UPDATE Admission SET sname='{name}' WHERE
adno='{adno}'"
cursor.execute(st)
mycon.commit()
print("Name updated successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

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

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

8
# student_data.py
import main_menu
import mysql.connector as co

def stu_menu():
while True:
print("\t\t.........................................")
print("\t\t***** SCHOOL MANAGEMENT SYSTEM *****")
print("\t\t.........................................")
print("\n\t\t************ 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("\t\t-----------------------------------------")

try:
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="root", 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.: ")

9
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 ('{}', '{}', '{}', '{}', '{}', '{}',
'{}', '{}')").format(
session, stname, stclass, stsec, stroll,
*subjects)

cursor.execute(query)
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="root", 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()

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

10
def delete_stu_details():
try:
mycon = co.connect(host="localhost", user="root",
passwd="root", database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
query = f"DELETE FROM Student WHERE stroll='{stroll}'"
cursor.execute(query)
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("\t\t-----------------------------------------")

try:
choice = int(input("Enter your choice: "))
if choice == 1:
edit_name()
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():
try:
mycon = co.connect(host="localhost", user="root",
passwd="root", database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
name = input("Enter Correct Name: ")

11
query = f"UPDATE Student SET stname='{name}' WHERE
stroll='{stroll}'"
cursor.execute(query)
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="root", database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
sub1 = input("Enter Correct First Subject: ")
query = f"UPDATE Student SET sub1='{sub1}' WHERE
stroll='{stroll}'"
cursor.execute(query)
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="root", database="MPS")
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
sub2 = input("Enter Correct Second Subject: ")
query = f"UPDATE Student SET sub2='{sub2}' WHERE
stroll='{stroll}'"
cursor.execute(query)
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="root", database="MPS")

12
cursor = mycon.cursor()
stroll = input("Enter Roll No.: ")
sub3 = input("Enter Correct Third Subject: ")
query = f"UPDATE Student SET sub3='{sub3}' WHERE
stroll='{stroll}'"
cursor.execute(query)
mycon.commit()
print("Third subject updated successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
cursor.close()
mycon.close()

13
# fee_details.py
import main_menu
import mysql.connector

def fee_menu():
while True:
print("\t\t.........................................")
print("\t\t***** SCHOOL MANAGEMENT SYSTEM *****")
print("\t\t.........................................")
print("\n\t\t************ FEE DETAILS ************")
print("1: Deposit Fee")
print("2: View Fee of All Students")
print("3: View Fee of a Particular Student")
print("4: Return")
print("\t\t-----------------------------------------")

try:
userInput = int(input("Please Select Option: "))
except ValueError:
print("\nError: That's not a valid number.")
else:
if userInput == 1:
feeDeposit()
elif userInput == 2:
feeView()
elif userInput == 3:
feeViewPart()
elif userInput == 4:
return
else:
print("Error: Invalid choice. Try again.")
input("Press Enter to continue...")

def feeDeposit():
try:
mydb = mysql.connector.connect(host="localhost",
user="root", passwd="root", database="MPS")
mycursor = mydb.cursor()
roll = int(input("Enter the Admission Number: "))
feeDeposit = int(input("Enter the Fee to be Deposited:
"))
month = input("Enter the Month of Fee: ")

sql = "INSERT INTO Fees (adno, FeeDeposit, Month)


VALUES (%s, %s, %s)"
values = (roll, feeDeposit, month)

mycursor.execute(sql, values)
mydb.commit()
print("Fee has been Deposited Successfully!")
except Exception as e:

14
print(f"Error: {e}")
finally:
mycursor.close()
mydb.close()

def feeView():
print("\t\t******** ALL FEE DETAILS ********")
try:
mydb = mysql.connector.connect(host="localhost",
user="root", passwd="root", database="MPS")
mycursor = mydb.cursor()
sql = ("SELECT Admission.adno, Admission.sname,
Admission.clas, SUM(Fees.FeeDeposit), COUNT(Fees.month) "
"FROM Admission "
"JOIN Fees ON Admission.adno = Fees.adno "
"GROUP BY adno")
mycursor.execute(sql)
results = mycursor.fetchall()

months = ['April', 'May', 'June', 'July', 'August',


'September',
'October', 'November', 'December',
'January', 'February', 'March']

for record in results:


record = list(record)
last_month_paid = record.pop()
record.append(months[last_month_paid - 1])
print(record)
print(f" Fee left from
{months[last_month_paid]}.\n")
except Exception as e:
print(f"Error: {e}")
finally:
mycursor.close()
mydb.close()

def feeViewPart():
print("\t\t****VIEW FEE FOR A PARTICULAR STUDENT ****")
try:
mydb = mysql.connector.connect(host="localhost",
user="root", passwd="root", database="MPS")
mycursor = mydb.cursor()
admno = int(input("Enter the Admission Number of the
Student: "))

sql = ("SELECT Admission.adno, Admission.sname,


Admission.clas, SUM(Fees.FeeDeposit), COUNT(Fees.month) "
"FROM Admission "
"INNER JOIN Fees ON Admission.adno = Fees.adno
AND Fees.adno = %s")

15
values = (admno,)

mycursor.execute(sql, values)
results = mycursor.fetchall()

months = ['April', 'May', 'June', 'July', 'August',


'September',
'October', 'November', 'December',
'January', 'February', 'March']

for record in results:


record = list(record)
last_month_paid = record.pop()
record.append(months[last_month_paid - 1])
print("\n", record, "\n")
print(f"Fee left from
{months[last_month_paid]}.\n")
except Exception as e:
print(f"Error: {e}")
finally:
mycursor.close()
mydb.close()

16
OUTPUTS

*MAIN_MENU*
.............................................
*********SCHOOL MANAGEMENT SYSTEM*********
.............................................
*********BEDI INTERNATIONAL SCHOOL*********
*1. Admission*
*2. Student Data*
*3. Fee Details*
*4. Exit*
.............................................
Enter your choice : 1

.............................................
*********School Management System*********
.............................................
**Admission**
*1. Add New Admission Details*
*2. Show Admission Details*
*3. Search Admission record*
*4. Deletion of Record*
*5. Update Admission Details*
*6. Return*
.............................................
Enter your choice : 1

17
*Admission*

**Add New Admission Details**,

Input: 101, 1, Ramesh Kumar, 1234 MG Road,


9876543210, 10
Ouput: Record has been saved in admission table

**Show Admission Details**,

Input: 101
Ouput: (101, 1, 'Ramesh Kumar', '1234 MG Road',
'9876543210', '10')

**Search Admission Record**,

Input: 101
Output: [(101, 1, 'Ramesh Kumar', '1234 MG Road',
'9876543210', '10')]

**Delete Admission Record**,

Input: 101
Output: Record has been deleted

**Update Admission Details*,

Input: 1: Edit Name, Input: 101, Sanjay Kumar


Ouput: Data updated successfully

18
*STUDENT_DATA*

**Add Student Record**,

Input: 2023-2024, Priya Yadav, 9, A, 15, Math,


Science, English
Ouput: Record has been saved in admission table

**Show Student Record**,

Ouput: ('2023-2024', 'Priya Yadav', '9', 'A', 15,


'Math', 'Science', 'English')

**Search Student Record**,

Input: 15
Output: [('2023-2024', 'Priya Yadav', '9', 'A',
15, 'Math', 'Science', 'English')]

**Delete Student Record**,

Input: 15
Ouput: Record has been deleted

19
*FEE_DETAILS*

**Deposit Fee**,

Input: 101, 5000, April


Ouput: Fee has been Deposited Successfully!

**View Fee of all Student**,

Ouput: [101, 'Ramesh Kumar', '10', 5000, 'April']


Fee left from April

**View Fee of Particular Student**,

Input: 111
Ouput: [111, Shikhar Kumar', '21', 5000, 'April']
Fee left from April

20
TABLES USED
*Admission Table,

*Student Table,

*Fees Table,

21
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.

22

You might also like