SRI CHAITANYA TECHNO SCHOOL ,IYYAPPANTHANGAL
ACADEMIC YEAR: 2024-25
                        PROJECT REPORT ON
              (ENTER THE NAME OF THE PROJECT)
ROLL NO         :
NAME            :       RAKSHITH KUMAR
CLASS           :       XII
SUBJECT         :       Computer Science
SUB CODE        :       083
PROJECT GUIDE : Mrs. M. Sashi Kala
                    PGT (Computer Science)
                    SRI CHAITANYA TECHNO SCHOOL
                    IYYAPPANTHANGAL, CHENNAI
                                                    1
        SRI CHAITANYA TECHNO SCHOOL IYYAPPANTHANGAL
                                CERTIFICATE
        This is to certify that Cadet Rakshith Kumar Roll No:_____________ has
successfully completed the project Work entitled ONLINE GGROCERY INVENTORY
in the subject COMPUTER SCIENCE (083) laid down in the regulations of CBSE for
the purpose of    Practical Examination in Class XII to be held in Sri Chaitanya
Techno School IYYAPPANTHANGAL on SR.CIPL.
DATE:
                                                            PRINCIPAL
INTERNAL EXAMINER                                         EXTERNAL EXAMINER
                                                                               2
                               ACKNOWLEDGEMENT
       Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of
this project.
       I express deep sense of gratitude to almighty God for giving me strength for the
successful completion of the project.
       I express my heartfelt gratitude to my parents for constant encouragement while
carrying out this project.
       I gratefully acknowledge the contribution of the individuals who contributed in
bringing this project up to this level, who continues to look after me despite my flaws,
       I express my deep sense of gratitude to the luminary The Principal, who has
been continuously motivating and extending their helping hand to us.
       My sincere thanks to Mrs. M. Sashi Kala Master In-charge, A guide, Mentor all
the above a friend, who critically reviewed my project and helped in solving each and
every problem, occurred during implementation of the project
       The guidance and support received from all the members who contributed and
who are contributing to this project, was vital for the success of the project. I am
grateful for their constant support and help.
                                                                                       3
Table of Contents
    S.No                               Topic        Page No.
1          Certificate                         2
2          Acknowledgement                     3
3          Hardwares and Softwares Required    5
4          Introduction                        6
5          Python Source Code                  9
6          MySQL Database                      12
7          Outputs                             15
8          References                          23
                                                               4
Hardwares and Softwares Required
Hardware Requirements:
  •   Desktop Computer / Laptop (Minimum 4GB RAM, Dual-Core Processor)
  •   Hard Disk Space: 100 MB (Minimum for Python and MySQL setup)
  •   Mobile Phone (Optional, for screenshots or documentation support)
Software Requirements:
  •   Operating System: Windows 10/11, macOS, or Linux
  •   Python Version: 3.8 or higher
  •   MySQL Database Server: MySQL 8.0 or higher
  •   IDE: Visual Studio Code / PyCharm / Any preferred IDE
  •   Required Python Libraries:
         o mysql-connector-python (for database connectivity)
         o tkinter (for graphical user interface)
         o os (for file system access)
         o datetime (for handling date and time)
                                                                          5
Introduction
The Online Grocery Store Inventory project is designed to manage
and track the inventory of an online grocery store. It allows store
managers to add, update, and delete items, as well as view inventory
in real time. This project combines Python for application logic with
MySQL for database management.
Objective of the Project
The main objective of this project is to develop an efficient inventory
management system for an online grocery store. The system should:
   •   Enable managers to add, view, update, and delete grocery items.
   •   Store grocery item details such as name, quantity, price, and category.
   •   Demonstrate how Python can be used to interface with SQL databases
       for data management.
                                                                                 6
Features of the Online Grocery Store Inventory
 1. Add New Items: Users can add items with details like item
    name, quantity, price, and category.
 2. View Inventory: Displays the list of all items available in the
    inventory.
 3. Update Item Details: Users can update details of specific items
    in the inventory.
 4. Delete Items: Users can delete specific items from the
    inventory.
 5. Graphical User Interface (GUI): A simple, user-friendly
    interface built using tkinter.
                                                                      7
Python Source Code
Here is the complete source code for the Online Grocery Store Inventory project.
import mysql.connector
import tkinter as tk
from tkinter import messagebox
# Connect to MySQL Database
db = mysql.connector.connect(
    host="localhost",
    user="root",
    password="password",
    database="grocery_inventory"
)
cursor = db.cursor()
# Function to add a new item
def add_item():
    item_name = item_entry.get()
    category = category_entry.get()
    quantity = quantity_entry.get()
    price = price_entry.get()
    query = "INSERT INTO inventory (item_name, category, quantity, price)
VALUES (%s, %s, %s, %s)"
    cursor.execute(query, (item_name, category, quantity, price))
    db.commit()
    messagebox.showinfo("Success", "Item added successfully!")
# GUI Setup
window = tk.Tk()
window.title("Online Grocery Store Inventory")
tk.Label(window, text="Item Name").grid(row=0, column=0)
tk.Label(window, text="Category").grid(row=1, column=0)
tk.Label(window, text="Quantity").grid(row=2, column=0)
tk.Label(window, text="Price").grid(row=3, column=0)
item_entry = tk.Entry(window)
category_entry = tk.Entry(window)
quantity_entry = tk.Entry(window)
price_entry = tk.Entry(window)
item_entry.grid(row=0, column=1)
category_entry.grid(row=1, column=1)
quantity_entry.grid(row=2, column=1)
price_entry.grid(row=3, column=1)
tk.Button(window, text="Add Item", command=add_item).grid(row=4, column=1)
window.mainloop()
                                                                                   8
MySQL Database
Database Name: grocery_inventory
Table Structure:
| Table Name: inventory |
Column Name         Data Type                   Description
item_id       INT (Primary Key)   Unique ID for each item
item_name     VARCHAR(255)        Name of the item
category      VARCHAR(100)        Category of the item
quantity      INT                 Quantity of the item available
price         DECIMAL(10, 2)      Price of the item
date_added TIMESTAMP (Default) Timestamp of when the item was added
SQL Query to Create Table
CREATE TABLE inventory (
    item_id INT AUTO_INCREMENT PRIMARY KEY,
    item_name VARCHAR(255),
    category VARCHAR(100),
    quantity INT,
    price DECIMAL(10, 2),
    date_added TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
                                                                      9
Outputs
Screenshots to Include:
   1.   Adding an Item - Demonstrate how items are added via the GUI.
   2.   Viewing Inventory - Display the current list of items in the inventory.
   3.   Updating an Item - Show how item details are updated.
   4.   Deleting an Item - Show how items are removed from the inventory.
Sample Output
+----+------------+----------+----------+-------+---------------------+
| id | item_name | category | quantity | price | date_added           |
+----+------------+----------+----------+-------+---------------------+
| 1 | Apples      | Fruits   |       50 | 2.50 | 2024-03-22 10:23:45 |
| 2 | Rice        | Grains   |      100 | 50.00 | 2024-03-23 12:45:21 |
+----+------------+----------+----------+-------+---------------------+
                                                                                  10
References
 1.   Python Documentation - python.org
 2.   MySQL Documentation - mysql.com
 3.   W3Schools - w3schools.com
 4.   GeeksforGeeks - geeksforgeeks.org
                                          11