Computer Class 12 Project Final
Computer Class 12 Project Final
Computer Class 12 Project Final
Prinipal’s signature:
Subject teacher:
Examiner:
Source Code
import mysql.connector
# Creating a cursor
cursor = conn.cursor()
cursor.execute(
CREATE TABLE IF NOT EXISTS teachers (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255),
subject VARCHAR(255)
)
)
def delete_student(student_id):
# Delete a student record from the database
cursor.execute("DELETE FROM students WHERE id = %s",
(student_id,))
conn.commit()
print("Student record deleted successfully!")
def delete_teacher(teacher_id):
# Delete a teacher record from the database
cursor.execute("DELETE FROM teachers WHERE id = %s",
(teacher_id,))
conn.commit()
print("Teacher record deleted successfully!")
def search_student(student_id):
# Search for a student record in the database
cursor.execute("SELECT * FROM students WHERE id = %s",
(student_id,))
result = cursor.fetchone()
if result:
print("Student record found:", result)
else:
print("Student record not found.")
def search_teacher(teacher_id):
# Search for a teacher record in the database
cursor.execute("SELECT * FROM teachers WHERE id = %s",
(teacher_id,))
result = cursor.fetchone()
if result:
print("Teacher record found:", result)
else:
print("Teacher record not found.")
def display_students():
# Display all student records in the database
cursor.execute("SELECT * FROM students")
results = cursor.fetchall()
if results:
for result in results:
print(result)
else:
print("No student records found.")
def display_teachers():
# Display all teacher records in the database
cursor.execute("SELECT * FROM teachers")
results = cursor.fetchall()
if results:
for result in results:
print(result)
else:
print("No teacher records found.")
Acknowledgments
Date: Name:
Variables & Functions description of coding.
Database Connection:
Key Features:
Attendance Tracking:
Communication Module:
Database Connectivity:
The system uses SQL/MySQL for data storage,
ensuring robust and scalable database management.
Data is organized efficiently to support quick retrieval
and reporting.
User-Friendly Interface: