SV - COMPUTER SCIENCE PROJECT Final
SV - COMPUTER SCIENCE PROJECT Final
SYSTEM
PROJECT REPORT
BY T.SASIVARNAN
Enrollment No:
Mrs. C.KALAIMANI
M.Sc(cs),Mphil,B.Ed
i
AKSHAYA ACADEMY CBSE SENIOR SECONDARY
SCHOOL ODDANCHATRAM
COMPUTER SCIENCE
2024-2025
BONAFIDE CERTIFICATE
PRINCIPAL
ii
ACKNOWLEDGEMENT
successfully.
iii
TABLE OF CONTENTS
02 SYSTEM REQUIREMENTS 2
03 FLOW CHART 3
05 SOURCE CODE 6
06 OUTPUT SCREENSHOTS 14
07 CONCLUSION 18
08 BIBILIOGRAPHY
19
iv
01.INTRODUCTION
all about software for School Management. It helps the School to have a full-
fledged control over his/her stall. It adds a new student; update details of
existing student data ,view all current student data. Besides it adds Fee or a
student, exam results for a student, It can also manage staffs working in a
school.
script and a database (MYSQL database). Talking about the program ,it is
system. The person can use all those available capabilities without difficulty
1
02. SYSTEM REQUIREMENTS
2
03.FLOWCHART
3
4
04.OBJECTIVES OF THE PROJECT
good software.
problems.
software development.
5
05.SOURCE CODE
import mysql.connector
import os
from time import sleep
# Functions
def insert1():
sname = input("Enter Student Name: ")
admno = int(input("Enter Admission No: "))
dob = input("Enter Date of Birth (yyyy-mm-dd): ")
cls = input("Enter class for admission: ")
cty = input("Enter City: ")
sql = "INSERT INTO student (sname, admno, dob, cls, cty) VALUES (%s,
%s, %s, %s, %s)"
6
try:
cursor.execute(sql, (sname, admno, dob, cls, cty))
db.commit()
print('\nData saved successfully\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
def display1():
try:
cursor.execute("SELECT * FROM student")
results = cursor.fetchall()
for c in results:
print(f"(sname={c[0]}, admno={c[1]}, dob={c[2]}, cls={c[3]},
cty={c[4]})")
except mysql.connector.Error as err:
print("Error:", err)
input("Press Enter to continue")
def update1():
admno = int(input("Enter Admission No: "))
new_class = input("Enter new class: ")
sql = "UPDATE student SET cls = %s WHERE admno = %s"
try:
cursor.execute(sql, (new_class, admno))
db.commit()
print('\nData updated successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
def delete1():
admno = int(input("Enter Admission No to delete: "))
sql = "DELETE FROM student WHERE admno = %s"
try:
ans = input("Are you sure you want to delete the record (y/n): ")
if ans.lower() == 'y':
cursor.execute(sql, (admno,))
db.commit()
print('\nRecord deleted successfully..\n')
except mysql.connector.Error as err:
7
print("Error:", err)
db.rollback()
input("Press Enter to continue")
def insert2():
ename = input("Enter Employee Name: ")
empno = int(input("Enter Employee No: "))
job = input("Enter Designation: ")
hiredate = input("Enter Date of Joining (YYYY-MM-DD): ")
sql = "INSERT INTO emp (ename, empno, job, hiredate) VALUES (%s,
%s, %s, %s)"
try:
cursor.execute(sql, (ename, empno, job, hiredate))
db.commit()
print('\nData saved successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
def display2():
try:
cursor.execute("SELECT * FROM emp")
results = cursor.fetchall()
for c in results:
print(f"(empno={c[1]}, ename={c[0]}, job={c[2]}, hiredate={c[3]})")
except mysql.connector.Error as err:
print("Error:", err)
input("Press Enter to continue")
def update2():
empno = int(input("Enter Employee No: "))
new_job = input("Enter new designation: ")
sql = "UPDATE emp SET job = %s WHERE empno = %s"
try:
cursor.execute(sql, (new_job, empno))
db.commit()
print('\nData updated successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
8
def delete2():
empno = int(input("Enter Employee No to delete: "))
sql = "DELETE FROM emp WHERE empno = %s"
try:
ans = input("Are you sure you want to delete the record (y/n): ")
if ans.lower() == 'y':
cursor.execute(sql, (empno,))
db.commit()
print('\nRecord deleted successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
def insert3():
admno = int(input("Enter Admission No: "))
fee = float(input("Enter Fee Amount: "))
month = input("Enter Month: ")
sql = "INSERT INTO fee (admno, fee, month) VALUES (%s, %s, %s)"
try:
cursor.execute(sql, (admno, fee, month))
db.commit()
print('\nData saved successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
def display3():
try:
cursor.execute("SELECT * FROM fee")
results = cursor.fetchall()
for c in results:
print(f"(admno={c[0]}, fee={c[1]}, month={c[2]})")
except mysql.connector.Error as err:
print("Error:", err)
input("Press Enter to continue")
def update3():
admno = int(input("Enter Admission No: "))
new_fee = float(input("Enter new fee amount: "))
9
new_month = input("Enter new month: ")
sql = "UPDATE fee SET fee = %s, month = %s WHERE admno = %s"
try:
cursor.execute(sql, (new_fee, new_month, admno))
db.commit()
print('\nData updated successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
def delete3():
admno = int(input("Enter Admission No to delete: "))
sql = "DELETE FROM fee WHERE admno = %s"
try:
ans = input("Are you sure you want to delete the record (y/n): ")
if ans.lower() == 'y':
cursor.execute(sql, (admno,))
db.commit()
print('\nRecord deleted successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
def insert4():
sname = input("Enter Student Name: ")
admno = int(input("Enter Admission No: "))
per = float(input("Enter Percentage: "))
res = input("Enter Result: ")
sql = "INSERT INTO exam (sname, admno, per, res) VALUES (%s, %s,
%s, %s)"
try:
cursor.execute(sql, (sname, admno, per, res))
db.commit()
print('\nData saved successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
10
def display4():
try:
cursor.execute("SELECT * FROM exam")
results = cursor.fetchall()
for c in results:
print(f"(sname={c[0]}, admno={c[1]}, per={c[2]}, res={c[3]})")
except mysql.connector.Error as err:
print("Error:", err)
input("Press Enter to continue")
def update4():
admno = int(input("Enter Admission No: "))
new_per = float(input("Enter new percentage: "))
def delete4():
admno = int(input("Enter Admission No to delete: "))
sql = "DELETE FROM exam WHERE admno = %s"
try:
ans = input("Are you sure you want to delete the record (y/n): ")
if ans.lower() == 'y':
cursor.execute(sql, (admno,))
db.commit()
print('\nRecord deleted successfully..\n')
except mysql.connector.Error as err:
print("Error:", err)
db.rollback()
input("Press Enter to continue")
11
def selection(choice):
if choice == 1:
print("\nSTUDENT MANAGEMENT SYSTEM")
print("a. New Admission\nb. Update Student Details\nc. Issue TC\nd.
Display Student Records")
c = input("Enter choice (a-d): ").lower()
if c == 'a': insert1()
elif c == 'b': update1()
elif c == 'c': delete1()
elif c == 'd': display1()
else: print("Invalid choice.")
elif choice == 2:
print("\nEMPLOYEE MANAGEMENT SYSTEM")
print("a. Add New Employee\nb. Update Employee Details\nc. Remove
Employee\nd. Display Employee Records")
c = input("Enter choice (a-d): ").lower()
if c == 'a': insert2()
elif c == 'b': update2()
elif c == 'c': delete2()
12
# Main loop for the program
while True:
print('-----------------------------------\nWELCOME TO SCHOOL
MANAGEMENT SYSTEM\n-----------------------------------')
print("1. STUDENT MANAGEMENT")
print("2. EMPLOYEE MANAGEMENT")
print("3. FEE MANAGEMENT")
print("4. EXAM MANAGEMENT")
print("5. EXIT")
try:
choice = int(input("Enter your choice (1-5): "))
if choice == 5:
print("Exiting program....")
exit()
break
elif 1 <= choice <= 4:
selection(choice)
else:
print("Invalid choice! Try again.")
except ValueError:
print("Please enter a valid number.")
13
06.OUTPUT SCREENSHOTS
14
6.3 Deleting a student data
15
6.5 Adding new staff details
16
6.7 Deleting a staff record
17
07.CONCLUSION
I grant you all the permission to this program and later on, it can be modified.
18
08.BIBILIOGRAPHY
❖ https://wikipedia.com/
❖ https://python.mykvs.in/
THANK YOU
19