Time Table Management System Project Report
Front Page
Time Table Management System
Developed by: Pragati
Class: 12th
CBSE Board
Academic Year: 2024-2025
Certificate
This is to certify that Pragati, a student of Class 12th, has successfully completed the
Computer Science project titled "Time Table Management System" under the
guidance of [Teacher's Name] for the academic year 2024-2025. The project adheres
to the curriculum prescribed by the Central Board of Secondary Education (CBSE)
and demonstrates application of database and Python programming concepts.
Signature of Guide: ___________________
Date: _______________
Acknowledgement
I would like to express my sincere gratitude to my Computer Science teacher,
[Teacher's Name], for their invaluable guidance and encouragement throughout this
project. I also thank my school for providing the resources and platform to work on
this project. Finally, I am grateful to my family and friends for their support.
Table of Contents
1. Introduction
2. Objectives
3. System Requirements
4. Methodology
5. Features of the System
6. Implementation
7. Challenges Faced
8. Screenshots (Optional)
9. Source Code
10. Conclusion
11. Bibliography
1. Introduction
The Time Table Management System is designed to simplify the process of
managing class schedules, teacher assignments, and classroom availability. This
project combines Python programming with a MySQL database to provide an
efficient and user-friendly system.
2. Objectives
1. To create a user-friendly application for managing timetables.
2. To utilize Python for backend programming and MySQL for data storage.
3. To demonstrate CRUD operations (Create, Read, Update, Delete) with database integration.
3. System Requirements
Hardware:
Processor: Intel i3 or above
RAM: 4 GB or more
Hard Disk: 500 GB or more
Software:
Python 3.x
MySQL Server
Python Libraries: mysql-connector-python, tabulate
4. Methodology
1. Database Design: Create a timetable table with columns for class_name, subject,
teacher, day, and time_slot.
2. Backend Development: Write Python functions to handle CRUD operations with MySQL.
3. Testing: Verify the program by adding, viewing, updating, and deleting records.
5. Features of the System
Create timetable entries for different classes.
View the complete timetable.
Update existing entries.
Delete specific entries.
6. Implementation
Key Python Functions:
Database Connection: Establish a connection to the MySQL database.
Create Table: Automatically create the required table if it doesn't exist.
CRUD Operations:
o Add new timetable entries.
o View all timetable entries.
o Update existing entries.
o Delete specific entries.
7. Challenges Faced
1. Initial errors in setting up the MySQL database.
2. Debugging SQL queries and ensuring correct data insertion and retrieval.
3. Managing user input validation to prevent invalid data entries.
8. Screenshots
9. Source Code
import mysql.connector
def connect_to_database():
try:
connection = mysql.connector.connect(
host="localhost",
user="root",
password="",
database="time_table_db"
)
return connection
except mysql.connector.Error as err:
print(f"Error: {err}")
return None
def create_tables():
connection = connect_to_database()
if connection:
cursor = connection.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS timetable (
id INT AUTO_INCREMENT PRIMARY KEY,
class_name VARCHAR(50),
subject VARCHAR(50),
teacher VARCHAR(50),
day VARCHAR(20),
time_slot VARCHAR(20)
);
""")
connection.commit()
cursor.close()
connection.close()
print("Table created successfully!")
else:
print("Failed to create table.")
def add_timetable_entry():
connection = connect_to_database()
if connection:
cursor = connection.cursor()
class_name = input("Enter Class Name: ")
subject = input("Enter Subject: ")
teacher = input("Enter Teacher: ")
day = input("Enter Day: ")
time_slot = input("Enter Time Slot: ")
query = """
INSERT INTO timetable (class_name, subject, teacher, day, time_slot)
VALUES (%s, %s, %s, %s, %s);
"""
cursor.execute(query, (class_name, subject, teacher, day, time_slot))
connection.commit()
print("Timetable entry added successfully!")
cursor.close()
connection.close()
else:
print("Failed to add timetable entry.")
def view_timetable():
connection = connect_to_database()
if connection:
cursor = connection.cursor()
cursor.execute("SELECT * FROM timetable;")
rows = cursor.fetchall()
if rows:
print("\nTimetable:")
for row in rows:
print(f"ID: {row[0]}, Class: {row[1]}, Subject: {row[2]}, Teacher: {row[3]}, Day: {row[4]}, Time:
{row[5]}")
else:
print("No timetable entries found.")
cursor.close()
connection.close()
else:
print("Failed to retrieve timetable.")
def update_timetable_entry():
connection = connect_to_database()
if connection:
cursor = connection.cursor()
entry_id = input("Enter the ID of the entry to update: ")
class_name = input("Enter new Class Name: ")
subject = input("Enter new Subject: ")
teacher = input("Enter new Teacher: ")
day = input("Enter new Day: ")
time_slot = input("Enter new Time Slot: ")
query = """
UPDATE timetable
SET class_name = %s, subject = %s, teacher = %s, day = %s, time_slot = %s
WHERE id = %s;
"""
cursor.execute(query, (class_name, subject, teacher, day, time_slot, entry_id))
connection.commit()
print("Timetable entry updated successfully!")
cursor.close()
connection.close()
else:
print("Failed to update timetable entry.")
def delete_timetable_entry():
connection = connect_to_database()
if connection:
cursor = connection.cursor()
entry_id = input("Enter the ID of the entry to delete: ")
query = "DELETE FROM timetable WHERE id = %s;"
cursor.execute(query, (entry_id,))
connection.commit()
print("Timetable entry deleted successfully!")
cursor.close()
connection.close()
else:
print("Failed to delete timetable entry.")
def main_menu():
while True:
print("\n--- Enhanced Timetable Management ---")
print("1. Create Table")
print("2. Add Timetable Entry")
print("3. View Timetable")
print("4. Update Timetable Entry")
print("5. Delete Timetable Entry")
print("6. Exit")
choice = input("Enter your choice: ")
if choice == "1":
create_tables()
elif choice == "2":
add_timetable_entry()
elif choice == "3":
view_timetable()
elif choice == "4":
update_timetable_entry()
elif choice == "5":
delete_timetable_entry()
elif choice == "6":
print("Exiting... Goodbye!")
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main_menu()
10. Conclusion
The Time Table Management System is a practical application that simplifies
timetable management using Python and MySQL. This project enhanced my
understanding of database integration and Python programming.
11. Bibliography
1. Python Documentation: https://docs.python.org
2. MySQL Documentation: https://dev.mysql.com/doc
3. Stack Overflow: https://stackoverflow.com