SVKM’S NMIMS
Mukesh Patel School of Technology Management and
Engineering
ADVANCED DATABASE MANAGEMENT Project Report
for Course
ADVANCED DATABASE MANAGEMENT
by
Name NISHTHA B. DESAI KUNSH K. ANAND MAYANK
AGARWAL
Roll E217 E227 E257
No
SAP 70552200019 70552200029 70552200059
ID
B.Tech Sem V
Faculty: Dr. Varsha Nemade
Department of Computer Science
AY 2024-25
Index
Sl. No. Topic
1 Introduction
2 Design
3 Code
4 Implementation
5 Conclusion
6 Reference
INTRODUCTION
INVENTORY MANAGEMENT SYSTEM
The Desktop Application is an Inventory Management System. The user may add new products, delete
existing products, and view all the existing products in the system. It makes use of Python for the front-
end interface and MySQL as the backend database for the purpose of storing and retrieving data.
Objectives:
To provide a friendly interface for the management of inventory.
- Add new product information with name, quantity, and price details.
- Delete existing information about a product from stock.
- Show all product information in a more readable format.
Technologies Used:
- Programming Language: Python 3.13
- Database: MySQL Server 8.0.39
- GUI Framework: Tkinter
- Database Connector: MySQL Connector for Python
Requirements
Software Requirements:
1. Python 3.13 or higher for running the application.
2. MySQL Server: MySQL Server 8.0 or above must be installed.
3. MySQL Connector: The MySQL Connector library for Python should be installed.
Hardware Requirements:
Use a computer or laptop with at least 4 GB of RAM.
At least 100 MB of storage space in the application and database
DESIGN
Fig: ER diagram
Fig: EER diagram
Fig: Relational Schema
CODE
Database Setting:
1.Create Database:
```sql
CREATE DATABASE InventoryDB;
USE InventoryDB;
```
2. Create Products Table:
```sql
CREATE TABLE Products (
ProductID INT PRIMARY KEY AUTO_INCREMENT,
ProductName NVARCHAR(100),
Quantity INT,
Price DECIMAL(10, 2)
);
The below code is the implementation of Inventory Management System using Tkinter as GUI and
MySQL for the database:
```python
import mysql.connector
import tkinter as tk
from tkinter import messagebox
# MySQL connection using MySQL Connector
conn = mysql.connector.connect(
host='localhost',
user='root',
password='mayankbawa',
database='InventoryDB'
)
cursor = conn.cursor()
# Functions to manage inventory
def add_product():
product_name = product_name_entry.get()
quantity = quantity_entry.get()
price = price_entry.get()
if product_name == "" or quantity == "" or price == "":
messagebox.showwarning("Input Error", "All fields are required")
else:
try:
cursor.execute (END
"INSERT INTO Products (ProductName, Quantity, Price) VALUES (%s, %s, %s),
(product_name, quantity, price)
conn.commit()
messagebox.showinfo("Success", "Product added successfully!")
clear_entries()
fetch_products()
except mysql.connector.Error as e:
messagebox.showerror("Error", f"Failed to add product: {e}")
def delete_product():
global cursor, conn
try:
selected_product = product_listbox.get(product_listbox.curselection())
product_id = selected_product.split(' ')[0]
cursor.execute("DELETE FROM Products WHERE ProductID=%s", (product_id,))
conn.commit()
messagebox.showinfo("Success", "Product deleted successfully!")
fetch_products()
except mysql.connector.Error as e:
messagebox.showerror("Error", f"Failed to delete product: {e}")
def fetch_products():
product_listbox.delete(0, tk.END
product_name_entry.delete(0, tk.END)
quantity_entry.delete(0, tk.END)
price_entry.delete(0, tk.END)
# GUI Setup
root = tk.Tk()
root.title("Inventory Management System")
# Labels
tk.Label(root, text="Product Name:").grid(row=0, column=0, padx=10, pady=10)
tk.Label(root, text="Quantity:").grid(row=1, column=0, padx=10, pady=10)
tk.Label(root, text="Price:").grid(row=2, column=0, padx=10, pady=10)
# Entry widgets for input
product_name_entry = tk.Entry(root)
quantity_entry = tk.Entry(root)
price_entry = tk.Entry(root)
product_name_entry.grid(row=0, column=1, padx=10, pady=10)
quantity_entry.grid(row=1, column=1, padx=10, pady=10)
price_entry.grid(row=2, column=1, padx=10, pady=10)
# Buttons
add_button = tk.Button(root, text="Add Product", command=add_product)
delete_button = tk.Button(root, text="Delete Selected Product", command=delete_product)
add_button.grid(row=3, column=0, padx=10, pady=10)
delete_button.grid(row=3, column=1, padx=10, pady=10)
# Listbox to display products
product_listbox = tk.Listbox(root, width=50)
product_listbox.grid(row=4, column=0, columnspan=2, padx=10, pady=10)
# Fetch and display products on startup
fetch_products()
# Run the application
root.mainloop()
# Close the connection when done
conn.close().
-GUI Components: Tkinter will be used for GUI, along with labels, entry fields, buttons, and listbox.
- CRUD Operations
- Add Product: Adds a new product in the database.
- Delete Product: Deletes the chosen product from the database.
- Fetch Products: Retrieves all products and displays them in the listbox.
- Clear Entries: Clear the input fields
IMPLEMENTATION
Testing
1. Functional Testing :
Test adding product with valid input.
Test adding a product with missing fields so as to check whether it runs since input validation would
work.
Test deleting a selected product and verify it removes from the list
2. Usability Testing:
GUI is intuitive, with minimal effort required to navigate.
Make sure that the error and success messages are clear and should provide useful information, making
it easy for the user to diagnose problems.
3. Performance Testing:
Measure response time for adding and deleting products.
Check how the system behaves for a large number of products in the list.
Conclusion:
The Inventory Management System ensures realization of its goals for the user as it offers an easy way of
tracking the inventory of the product. The integration with MySQL ensures integrity of data and GUI
offered by this system is from Tkinter, which is user-friendly. Future development should include
authentication for the users, search functionality of products, and export and import functionality.
CONCLUSION
The Inventory Management System is designed to help users track and manage product
inventories efficiently. It offers a comprehensive solution by maintaining accurate records of
product quantities, pricing, and other details. This system reduces human error and enhances
stock organization.
A key strength is its integration with MySQL, ensuring reliable, secure, and scalable data
management. It handles large datasets while ensuring data integrity, so users can trust that the
information is accurate and up-to-date.
The system's Graphical User Interface (GUI), built using Tkinter, is user-friendly. It
simplifies tasks like adding new products, updating stock levels, and viewing inventory,
allowing users to navigate easily without extensive training.
Several future enhancements are planned, such as user authentication to restrict access,
providing an extra layer of security. Role-based control will define who can modify inventory
information. Product search functionality is another addition, allowing users to quickly locate
items in larger inventories, improving efficiency.
Additional features like export and import functionality will enable data backup and system
transfer, making integration with platforms like e-commerce sites seamless and preventing
issues like stockouts.
In conclusion, the Inventory Management System offers a solid foundation for inventory
control with real-time tracking and a simple interface. Future enhancements, such as
authentication and search functionalities, will make the system even more robust.
REFERENCE
1. Gupta, A., Kumar, M., & Prasad, A.(2021). "Development of an Inventory Management
System Using Python and MySQL." International Journal of Computer Science and
Engineering.
2. Tkinter Documentation. "Python Tkinter GUI Programming by Example."
3. MySQL Documentation. "MySQL 8.0 Reference Manual."
4. MySQL Connector Documentation. "MySQL Connector/Python Developer Guide."
5. Lundh, F. (1999). "An Introduction to Tkinter."
6. O'Reilly Media(2019). "Mastering GUI Programming with Python."
7. Patel, R., & Dave, P. (2022). "Optimizing Data Integrity in Inventory Management
Systems." Journal of Database Systems and Software Engineering.
8. GeeksforGeeks (2023). "Inventory Management System using Tkinter and MySQL."
9. Towler, G. (2018). "Database Systems: Design, Implementation, & Management."
10. Stack Overflow (2023). "Tkinter Inventory Management System Python Code Help."