0% found this document useful (0 votes)
19 views50 pages

Mini Project Report

This mini project report details the development of a desktop application for managing database records using Python's tkinter and MySQL. The application allows users to load, add, and delete data from four main tables: Employees, Department, Task, and Projects, through a user-friendly graphical interface. The project aims to simplify database interactions for non-technical users while ensuring data integrity and security.

Uploaded by

Vishal Bhagat
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)
19 views50 pages

Mini Project Report

This mini project report details the development of a desktop application for managing database records using Python's tkinter and MySQL. The application allows users to load, add, and delete data from four main tables: Employees, Department, Task, and Projects, through a user-friendly graphical interface. The project aims to simplify database interactions for non-technical users while ensuring data integrity and security.

Uploaded by

Vishal Bhagat
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/ 50

Mini Project Report

By

Student Name: Gagandeep

Roll Number: 2022a6r018

Semester - IV

Group - 08

Computer Science and Engineering (AI & ML)

Model Institute of Engineering & Technology (Autonomous)

(Permanently Affiliated to the University of Jammu, Accredited by NAAC with “A” Grade)

Jammu, India

2024
COM-402, Assignment-1

ASSIGNMENT

Subject Code: COM-402 Subject Name: Database Management System

Due Date: 18-05-2024

Question Blooms’ Maximum


Number Course Level Marks Marks Obtain
Outcomes

Q1
CO3, CO4, CO5 6 20

Total Marks 20

Faculty Signature: Mr. Navin Mani Upadhyay

Email: [email protected]

Assignment Objectives:
The objective of this assignment is to deepen the understanding of the Relational
Database Management System by exploring the concepts of MySQL and Relational
Model.

Q. Question BL CO Mark Total


No. s Mark
s

1. 1. Create the tables for the Company database in your


text, and populate with data.
2. Create a simple desktop app to load, add and delete
the data from the database. [Use any language
Python tk, c#, .net etc.]

Create a Mini Project report for the application you have


created.

2
COM-402, Assignment-1

Abstract

This project presents the design and implementation of a desktop application aimed at
simplifying the management of database records through a graphical user interface. The
application is developed using Python's tkinter library for the user interface and MySQL for the
backend database management system. The primary functionalities of the application include
loading, adding, and deleting data from selected database tables. Users can interact with four
main tables: Employees, Department, Task, and Projects.

The application architecture consists of a main interface that allows users to select a table and
perform desired operations through dynamically generated forms. Data validation and robust
error handling mechanisms ensure the integrity and reliability of database transactions. By
integrating the mysql-connector-python library, the application facilitates seamless
communication with the MySQL database, enabling efficient data retrieval and manipulation.

The Employees table manages employee details, the Department table handles
department-specific information, the Task table tracks tasks assigned to employees, and the
Projects table records project-related data. The use of environment variables for database
credentials and structured error handling ensures security and resilience against potential runtime
issues.

This project aims to provide an intuitive and user-friendly tool for database administrators and
developers, reducing the need for manual SQL query writing and enhancing productivity.
Overall, this application serves as a practical example of combining Python’s GUI capabilities
with relational database management, demonstrating effective software development practices.

3
COM-402, Assignment-1

Table of Contents

1. Introduction 5-6
1.1. Background 5
1.2. Objective
1.3. Scope
1.4. Problem Statement
2. Main Body
2.1. Frontend
2.2. Backend
2.3. Database Structure
2.4. How the GUI Helps Users
2.5. Example Workflow
3. Code and Queries
3.1.
3.2.
3.3.

4
COM-402, Assignment-1

1. Introduction

1.1. Background

In the digital era, managing data efficiently is crucial for the success of any organization.
Databases are essential for storing, organizing, and retrieving data, and they play a vital role in
various business operations. However, interacting directly with databases often requires
knowledge of SQL, which can be a barrier for non-technical users. Desktop applications with
graphical user interfaces (GUIs) provide a user-friendly alternative, enabling users to manage
data without writing complex queries. This project leverages Python's tkinter for GUI
development and MySQL for database management to create a desktop application that
simplifies database operations.

1.2. Objective

The primary objective of this project is to develop a desktop application that allows users to load,
add, and delete data from a database through an intuitive graphical user interface. The
application aims to:

● Provide a user-friendly interface for managing data in the Employees, Department, Task,
and Projects tables.
● Simplify database interactions by abstracting SQL queries behind easy-to-use buttons and
forms.
● Ensure data integrity and security through robust error handling and secure management
of database credentials.

1.3. Scope

The scope of this project includes:

● Development of a desktop application using Python's tkinter library for the GUI.
● Integration with a MySQL database to manage four tables: Employees, Department,
Task, and Projects.

5
COM-402, Assignment-1

● Implementation of core functionalities such as loading, adding, and deleting records in


the database.
● Ensuring the application is user-friendly and accessible to users with minimal technical
background.
● Providing secure and error-resistant database operations.

1.4. Problem Statement

Database management is a critical task that often requires knowledge of SQL and database
systems. This can pose a challenge for users who lack technical expertise, leading to
inefficiencies and potential errors in data handling. The existing solutions for database
management either require significant technical skills or are overly simplistic and lack the
necessary functionalities. There is a need for a robust yet user-friendly desktop application that
bridges this gap, allowing users to perform essential database operations without the need for
extensive technical knowledge. This project aims to address this problem by developing an
intuitive application that simplifies the management of database records while ensuring data
integrity and security.

6
COM-402, Assignment-1

2. Main Body

2.1. Frontend
The frontend of the application is developed using Python's tkinter library, which provides a
robust platform for creating graphical user interfaces (GUIs). tkinter is chosen for its simplicity
and ease of use, making it an ideal choice for rapid development of desktop applications. The
GUI consists of several components:

● Main Interface: The main window contains buttons for selecting different tables
(Employees, Department, Task, Projects) and performing actions such as loading, adding,
and deleting data.
● Action Buttons: Once a table is selected, action buttons (Load Data, Add Data, Delete
Data) appear, allowing users to perform CRUD (Create, Read, Update, Delete)
operations.
● Dynamic Forms: Depending on the selected action and table, the application generates
dynamic forms for user input. For instance, adding a new employee or deleting a task will
prompt the user to fill out relevant fields.

The intuitive layout and clear labels ensure that users can navigate and operate the application
with minimal training. Error messages and confirmations provide feedback and guide users
through the process, enhancing user experience and reducing the likelihood of errors.

2.2. Backend
The backend of the application is powered by MySQL, a reliable and widely-used relational
database management system (RDBMS). MySQL is chosen for its robustness, scalability, and
support for complex queries and transactions. The backend handles all database operations,
including:

● Database Connection: The application connects to the MySQL database using the
mysql-connector-python library, ensuring secure and efficient communication between
the GUI and the database.

7
COM-402, Assignment-1

● CRUD Operations: The backend performs all necessary CRUD operations. SQL queries
for selecting, inserting, and deleting records are abstracted behind the GUI buttons,
allowing users to perform these operations without writing SQL code.
● Error Handling: The backend includes robust error handling to manage database errors,
ensuring data integrity and providing clear error messages to the user.

2.3. Database Structure


The application's database, named "company," consists of four interconnected tables:

1. Employees:
● Columns: employee_id (Primary Key), name, position, salary, department_id
(Foreign Key)
● Description: Stores details about each employee, including their department
affiliation.
2. Department:
● Columns: department_id (Primary Key), name, location
● Description: Contains information about various departments within the company.
3. Task:
● Columns: task_id (Primary Key), description, status, employee_id (Foreign Key),
project_id (Foreign Key)
● Description: Tracks tasks assigned to employees, including their current status
and associated project.
4. Projects:
● Columns: project_id (Primary Key), name, start_date, end_date, department_id
(Foreign Key)
● Description: Records details about company projects, including the responsible
department.

2.4. How the GUI Helps Users

8
COM-402, Assignment-1

The GUI significantly enhances user productivity and data management efficiency in several
ways:

● User-Friendly Interface: The GUI simplifies database operations by providing a visual


interface for managing data. Users can select tables, view records, and perform actions
with just a few clicks, without needing to understand SQL syntax.
● Dynamic Forms: The application generates dynamic forms tailored to the selected action
and table, guiding users through data entry and ensuring that all required fields are
completed correctly.
● Immediate Feedback: Error messages and confirmations are provided in real-time,
helping users correct mistakes and understand the outcomes of their actions.
● Efficient Data Handling: Adding and deleting data is streamlined through dedicated
forms and buttons. Users can quickly input new records or remove outdated entries,
keeping the database up-to-date with minimal effort.
● Data Integrity: By abstracting SQL queries behind a user-friendly interface and
implementing robust error handling, the application minimizes the risk of database
corruption and ensures data consistency.

2.5. Example Workflow


A typical workflow for using the application might include:

1. Loading Data: A user selects the "Employees" table and clicks the "Load Data" button.
The application retrieves all employee records from the database and displays them in a
table format within the GUI.
2. Adding Data: To add a new employee, the user clicks the "Add Data" button. A form
appears, prompting the user to enter details such as name, position, salary, and
department ID. Upon submission, the application validates the input and inserts a new
record into the Employees table.
3. Deleting Data: To remove a task, the user selects the "Task" table and clicks the "Delete
Data" button. The user then enters the task ID in the prompted form. After confirmation,
the application deletes the specified task from the database.

9
COM-402, Assignment-1

3. Code and Queries:

ER Diagram:

Figure 1: ER Diagram of database-Company

10
COM-402, Assignment-1

Backend; MySQL Queries:

● Table- employee

CREATE TABLE employees (


employee_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
position VARCHAR(100),
salary DECIMAL(10, 2),
department_id INT
);

Table 1: Employees

● Table-dept

CREATE TABLE dept (


department_id INT AUTO_INCREMENT PRIMARY KEY,
department_name VARCHAR(100)
);

11
COM-402, Assignment-1

Table 2: Dept
● Table-projects

CREATE TABLE projects (


project_id INT PRIMARY KEY,
name VARCHAR(100),
start_date DATE,
end_date DATE,ye
department_id INT,
FOREIGN KEY (department_id) REFERENCES dept(department_id)
);

Table 3: Projects

● Table-task

CREATE TABLE task (


task_id INT PRIMARY KEY,
description VARCHAR(255),

12
COM-402, Assignment-1

status VARCHAR(50),
employee_id INT,
project_id INT,
FOREIGN KEY (employee_id) REFERENCES employees(employee_id),
FOREIGN KEY (project_id) REFERENCES projects(project_id)
);

Table 4: Tasks

Frontend; Python Code:

import tkinter as tk
from tkinter import messagebox, ttk
import mysql.connector

def get_connection():
return mysql.connector.connect(
host="localhost",
user="Na",
password="Aruvasu@2630",
database="company"
)

def choose_table(table_name):

13
COM-402, Assignment-1

global current_table
current_table = table_name
table_label.config(text=f"Selected Table: {table_name.capitalize()}")
show_action_buttons()

def show_action_buttons():
for widget in action_frame.winfo_children():
widget.destroy()

load_button = tk.Button(action_frame, text="Load Data", command=load_data)


load_button.pack(side=tk.LEFT, padx=5, pady=5)

add_button = tk.Button(action_frame, text="Add Data", command=add_data)


add_button.pack(side=tk.LEFT, padx=5, pady=5)

delete_button = tk.Button(action_frame, text="Delete Data",


command=delete_data)
delete_button.pack(side=tk.LEFT, padx=5, pady=5)

def load_data():
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute(f"SELECT * FROM {current_table}")
rows = cursor.fetchall()

cursor.execute(f"SHOW COLUMNS FROM {current_table}")


columns = [col[0] for col in cursor.fetchall()]

connection.close()

14
COM-402, Assignment-1

for widget in data_frame.winfo_children():


widget.destroy()

tree = ttk.Treeview(data_frame, columns=columns, show='headings')


for col in columns:
tree.heading(col, text=col)
tree.column(col, width=100)

for row in rows:


tree.insert("", tk.END, values=row)

tree.pack(fill=tk.BOTH, expand=True)

except mysql.connector.Error as error:


messagebox.showerror("Error", f"Failed to load data: {error}")

def add_data():
for widget in form_frame.winfo_children():
widget.destroy()

if current_table == "employees":
create_employee_form()
elif current_table == "projects":
create_project_form()
elif current_table == "task":
create_task_form()
elif current_table == "dept":
create_department_form()

def delete_data():
for widget in form_frame.winfo_children():

15
COM-402, Assignment-1

widget.destroy()

if current_table == "employees":
create_employee_delete_form()
elif current_table == "projects":
create_project_delete_form()
elif current_table == "task":
create_task_delete_form()
elif current_table == "dept":
create_department_delete_form()

def create_employee_form():
tk.Label(form_frame, text="Name:").grid(row=0, column=0, padx=5, pady=5)
name_entry = tk.Entry(form_frame)
name_entry.grid(row=0, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Position:").grid(row=1, column=0, padx=5, pady=5)


position_entry = tk.Entry(form_frame)
position_entry.grid(row=1, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Salary:").grid(row=2, column=0, padx=5, pady=5)


salary_entry = tk.Entry(form_frame)
salary_entry.grid(row=2, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Department ID:").grid(row=3, column=0, padx=5,


pady=5)
department_id_entry = tk.Entry(form_frame)
department_id_entry.grid(row=3, column=1, padx=5, pady=5)

16
COM-402, Assignment-1

submit_button = tk.Button(form_frame, text="Submit", command=lambda:


submit_employee_form(name_entry, position_entry, salary_entry,
department_id_entry))
submit_button.grid(row=4, column=1, padx=5, pady=5)

def create_project_form():
tk.Label(form_frame, text="Project Name:").grid(row=0, column=0, padx=5,
pady=5)
project_name_entry = tk.Entry(form_frame)
project_name_entry.grid(row=0, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Start Date:").grid(row=1, column=0, padx=5,


pady=5)
start_date_entry = tk.Entry(form_frame)
start_date_entry.grid(row=1, column=1, padx=5, pady=5)

tk.Label(form_frame, text="End Date:").grid(row=2, column=0, padx=5, pady=5)


end_date_entry = tk.Entry(form_frame)
end_date_entry.grid(row=2, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Department ID:").grid(row=3, column=0, padx=5,


pady=5)
project_department_id_entry = tk.Entry(form_frame)
project_department_id_entry.grid(row=3, column=1, padx=5, pady=5)

submit_button = tk.Button(form_frame, text="Submit", command=lambda:


submit_project_form(project_name_entry, start_date_entry, end_date_entry,
project_department_id_entry))
submit_button.grid(row=4, column=1, padx=5, pady=5)

def create_task_form():

17
COM-402, Assignment-1

tk.Label(form_frame, text="Description:").grid(row=0, column=0, padx=5,


pady=5)
description_entry = tk.Entry(form_frame)
description_entry.grid(row=0, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Status:").grid(row=1, column=0, padx=5, pady=5)


status_entry = tk.Entry(form_frame)
status_entry.grid(row=1, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Employee ID:").grid(row=2, column=0, padx=5,


pady=5)
task_employee_id_entry = tk.Entry(form_frame)
task_employee_id_entry.grid(row=2, column=1, padx=5, pady=5)

tk.Label(form_frame, text="Project ID:").grid(row=3, column=0, padx=5,


pady=5)
task_project_id_entry = tk.Entry(form_frame)
task_project_id_entry.grid(row=3, column=1, padx=5, pady=5)

submit_button = tk.Button(form_frame, text="Submit", command=lambda:


submit_task_form(description_entry, status_entry, task_employee_id_entry,
task_project_id_entry))
submit_button.grid(row=4, column=1, padx=5, pady=5)

def create_department_form():
tk.Label(form_frame, text="Department Name:").grid(row=0, column=0, padx=5,
pady=5)
department_name_entry = tk.Entry(form_frame)
department_name_entry.grid(row=0, column=1, padx=5, pady=5)

18
COM-402, Assignment-1

submit_button = tk.Button(form_frame, text="Submit", command=lambda:


submit_department_form(department_name_entry))
submit_button.grid(row=1, column=1, padx=5, pady=5)

def submit_employee_form(name_entry, position_entry, salary_entry,


department_id_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("INSERT INTO employees (name, position, salary,
department_id) VALUES (%s, %s, %s, %s)",
(name_entry.get(), position_entry.get(), salary_entry.get(),
department_id_entry.get()))
connection.commit()
connection.close()
load_data()
except mysql.connector.Error as error:
messagebox.showerror("Error", f"Failed to add data: {error}")

def submit_project_form(project_name_entry, start_date_entry, end_date_entry,


project_department_id_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("INSERT INTO projects (name, start_date, end_date,
department_id) VALUES (%s, %s, %s, %s)",
(project_name_entry.get(), start_date_entry.get(),
end_date_entry.get(), project_department_id_entry.get()))
connection.commit()
connection.close()
load_data()

19
COM-402, Assignment-1

except mysql.connector.Error as error:


messagebox.showerror("Error", f"Failed to add data: {error}")

def submit_task_form(description_entry, status_entry, task_employee_id_entry,


task_project_id_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("INSERT INTO task (description, status, employee_id,
project_id) VALUES (%s, %s, %s, %s)",
(description_entry.get(), status_entry.get(),
task_employee_id_entry.get(), task_project_id_entry.get()))
connection.commit()
connection.close()
load_data()
except mysql.connector.Error as error:
messagebox.showerror("Error", f"Failed to add data: {error}")

def submit_department_form(department_name_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("INSERT INTO dept (department_name) VALUES (%s)",
(department_name_entry.get(),))
connection.commit()
connection.close()
load_data()
except mysql.connector.Error as error:
messagebox.showerror("Error", f"Failed to add data: {error}")

def create_employee_delete_form():

20
COM-402, Assignment-1

tk.Label(form_frame, text="Employee ID:").grid(row=0, column=0, padx=5,


pady=5)
employee_id_entry = tk.Entry(form_frame)
employee_id_entry.grid(row=0, column=1, padx=5, pady=5)

submit_button = tk.Button(form_frame, text="Delete", command=lambda:


delete_employee_form(employee_id_entry))
submit_button.grid(row=1, column=1, padx=5, pady=5)

def create_project_delete_form():
tk.Label(form_frame, text="Project ID:").grid(row=0, column=0, padx=5,
pady=5)
project_id_entry = tk.Entry(form_frame)
project_id_entry.grid(row=0, column=1, padx=5, pady=5)

submit_button = tk.Button(form_frame, text="Delete", command=lambda:


delete_project_form(project_id_entry))
submit_button.grid(row=1, column=1, padx=5, pady=5)

def create_task_delete_form():
tk.Label(form_frame, text="Task ID:").grid(row=0, column=0, padx=5, pady=5)
task_id_entry = tk.Entry(form_frame)
task_id_entry.grid(row=0, column=1, padx=5, pady=5)

submit_button = tk.Button(form_frame, text="Delete", command=lambda:


delete_task_form(task_id_entry))
submit_button.grid(row=1, column=1, padx=5, pady=5)

def create_department_delete_form():
tk.Label(form_frame, text="Department ID:").grid(row=0, column=0, padx=5,
pady=5)

21
COM-402, Assignment-1

department_id_entry = tk.Entry(form_frame)
department_id_entry.grid(row=0, column=1, padx=5, pady=5)

submit_button = tk.Button(form_frame, text="Delete", command=lambda:


delete_department_form(department_id_entry))
submit_button.grid(row=1, column=1, padx=5, pady=5)

def delete_employee_form(employee_id_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("DELETE FROM employees WHERE employee_id = %s",
(employee_id_entry.get(),))
connection.commit()
connection.close()
load_data()
except mysql.connector.Error as error:
messagebox.showerror("Error", f"Failed to delete data: {error}")

def delete_project_form(project_id_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("DELETE FROM projects WHERE project_id = %s",
(project_id_entry.get(),))
connection.commit()
connection.close()
load_data()
except mysql.connector.Error as error:
messagebox.showerror("Error", f"Failed to delete data: {error}")

22
COM-402, Assignment-1

def delete_task_form(task_id_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("DELETE FROM task WHERE task_id = %s",
(task_id_entry.get(),))
connection.commit()
connection.close()
load_data()
except mysql.connector.Error as error:
messagebox.showerror("Error", f"Failed to delete data: {error}")

def delete_department_form(department_id_entry):
try:
connection = get_connection()
cursor = connection.cursor()
cursor.execute("DELETE FROM dept WHERE department_id = %s",
(department_id_entry.get(),))
connection.commit()
connection.close()
load_data()
except mysql.connector.Error as error:
messagebox.showerror("Error", f"Failed to delete data: {error}")

root = tk.Tk()
root.title("Company Database Management")

table_frame = tk.Frame(root)
table_frame.pack(padx=10, pady=10)

action_frame = tk.Frame(root)

23
COM-402, Assignment-1

action_frame.pack(padx=10, pady=10)

form_frame = tk.Frame(root)
form_frame.pack(padx=10, pady=10)

data_frame = tk.Frame(root)
data_frame.pack(padx=10, pady=10, fill=tk.BOTH, expand=True)

table_label = tk.Label(table_frame, text="Select a table to manage")


table_label.pack()

employees_button = tk.Button(table_frame, text="Employees", command=lambda:


choose_table("employees"))
employees_button.pack(side=tk.LEFT, padx=5, pady=5)

projects_button = tk.Button(table_frame, text="Projects", command=lambda:


choose_table("projects"))
projects_button.pack(side=tk.LEFT, padx=5, pady=5)

task_button = tk.Button(table_frame, text="Task", command=lambda:


choose_table("task"))
task_button.pack(side=tk.LEFT, padx=5, pady=5)

dept_button = tk.Button(table_frame, text="Department", command=lambda:


choose_table("dept"))
dept_button.pack(side=tk.LEFT, padx=5, pady=5)

root.mainloop()

24
COM-402, Assignment-1

Outputs

1. Interface

Output 1: Homepage interface

Output 1.1: Functions available

25
COM-402, Assignment-1

2. Function: LOAD

Output 2.1: Loaded data of Table Employees

Output 2.2: Selected Table Projects

26
COM-402, Assignment-1

Output 2.3: Loaded data of Table Projects

Output 2.4: Selected Table: Task

27
COM-402, Assignment-1

Output 2.5: Loaded data of Table Task

Output 2.6: Loaded data of Table Department

28
COM-402, Assignment-1

Output 2.7: Loaded data of Table Dept

29
COM-402, Assignment-1

3. Function: ADD

Output 3.1: Adding data in Table Employees

30
COM-402, Assignment-1

Output 3.2: New data added

31
COM-402, Assignment-1

Output 3.3: New added data in the database

32
COM-402, Assignment-1

33
COM-402, Assignment-1

34
COM-402, Assignment-1

35
COM-402, Assignment-1

36
COM-402, Assignment-1

37
COM-402, Assignment-1

38
COM-402, Assignment-1

39
COM-402, Assignment-1

4. Function: Delete

40
COM-402, Assignment-1

41
COM-402, Assignment-1

42
COM-402, Assignment-1

43
COM-402, Assignment-1

44
COM-402, Assignment-1

45
COM-402, Assignment-1

46
COM-402, Assignment-1

47
COM-402, Assignment-1

Summary

This project report details the development and implementation of a desktop application
designed to simplify database management tasks through an intuitive graphical user
interface (GUI). The application, built using Python's `tkinter` library for the frontend and
MySQL for the backend, allows users to efficiently load, add, and delete data in a
user-friendly manner.

The main features of the application include:

1. User-Friendly Interface: The GUI facilitates easy interaction with the database,
eliminating the need for users to write SQL queries. The interface is designed to be
intuitive, with clearly labeled buttons and forms for each operation.
2. Dynamic Data Management: Users can select from four primary tables—Employees,
Department, Task, and Projects. The application dynamically generates forms based on the
selected table and operation, ensuring that data entry and management are straightforward
and error-free.
3. Robust Backend Integration: The backend, powered by MySQL, ensures secure and
efficient database operations. The application uses the `mysql-connector-python` library for
seamless communication with the database, and robust error handling mechanisms provide
real-time feedback to users.
4. Efficient CRUD Operations: The application supports essential CRUD (Create, Read,
Update, Delete) operations, allowing users to quickly load data from the database, add new
records, and delete existing ones. These operations are abstracted behind the GUI, providing
a seamless experience for users.

The database schema consists of four interconnected tables:


- Employees: Stores employee details, including their department affiliation.
- Department: Contains information about various departments within the company.
- Task: Tracks tasks assigned to employees, including their current status and associated
project.

48
COM-402, Assignment-1

- Projects: Records details about company projects, including the responsible department.

The project demonstrates the effective integration of Python’s GUI capabilities with
MySQL’s robust database management. It offers a practical solution for organizations
looking to streamline their data management processes, making it accessible to users with
minimal technical background. By reducing the complexity of database operations, the
application enhances productivity and ensures data integrity.

In conclusion, this desktop application serves as a valuable tool for managing company data
efficiently. It combines the simplicity of a user-friendly interface with the power of a
relational database, providing a comprehensive solution for data management tasks.

49
COM-402, Assignment-1

Reference

● Python mysql. (n.d.). https://www.w3schools.com/python/python_mysql_getstarted.asp


● YouTube. (2018b, November 4). #73 python database connection | mysql. YouTube.
https://www.youtube.com/watch?v=vR5utJvN4JY
● YouTube. (2019, November 19). Tkinter course - create graphic user interfaces in python
tutorial. YouTube. https://www.youtube.com/watch?v=YXPyB4XeYLA
● Mini Project Report format. Ajay Bolar. (n.d.).
https://ajaybolar.weebly.com/mini-project-report-format.html
● Chat.openai.com. (n.d.). http://chat.openai.com/

50

You might also like