Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🛒 Grocery Management System

A simple Grocery Management System implemented in Python and Java using MySQL as the backend database.
This project demonstrates how to perform CRUD operations (Create, Read, Update, Delete) on grocery items using database connectivity.


📋 Features

  • ➕ Add new grocery items
  • ✏️ Update existing item details
  • ❌ Delete grocery items
  • 📄 View all grocery items
  • 🗄️ MySQL database integration
  • 💾 Persistent storage for grocery data
  • ⚙️ Error handling for invalid operations

🧠 Technologies Used

Component Technology
Programming Languages Python, Java
Database MySQL
Python Library mysql.connector
Java Library JDBC (Java Database Connectivity)
IDE / Tools VS Code / IntelliJ IDEA / MySQL Workbench

📦 Project Structure


📁 Grocery-Management-System
├── grocery_management.py         # Python implementation
├── GroceryManagementSystem.java  # Java implementation
├── grocery_db.sql                # Database schema file
├── screenshots/                  # Folder containing UI/output screenshots
│   ├── python_output.png
│   ├── java_output.png
│   └── er_diagram.png
├── README.md                     # Project documentation
└── LICENSE                       # Open-source license (MIT)


🗄️ Database Schema (MySQL)

You can create the database manually or execute the grocery_db.sql file.

SQL Script

CREATE DATABASE grocery_db;
USE grocery_db;

CREATE TABLE groceries (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    quantity INT NOT NULL,
    price FLOAT NOT NULL
);

🧩 Entity–Relationship (ER) Diagram

🧱 Text Representation

+-------------------+
|     GROCERY       |
+-------------------+
| id (PK)           |
| name              |
| quantity          |
| price             |
+-------------------+

📝 Explanation:

  • GROCERY is the main entity representing each item.

  • Each record has:

    • id → Primary Key (unique identifier)
    • name → Grocery item name
    • quantity → Available stock quantity
    • price → Price per unit/item

🖼️ Visual Representation of Database

file_2025-10-31_18 29 25

Setup and Installation

🐍 Python Version

The Python version uses the mysql.connector library for MySQL connectivity.

▶️ Steps to Run

  1. Install dependencies

    pip install mysql-connector-python
  2. Configure database credentials inside grocery_management.py:

    connection = mysql.connector.connect(
        host="localhost",
        user="root",
        password="your_password",
        database="grocery_db"
    )
  3. Run the program

    python grocery_management.py

☕ Java Version

The Java version uses JDBC for database communication.

▶️ Steps to Run

  1. Download and add MySQL Connector/J

  2. Configure database credentials inside GroceryManagementSystem.java:

    Connection connection = DriverManager.getConnection(
        "jdbc:mysql://localhost:3306/grocery_db", "root", "your_password"
    );
  3. Compile and run

    javac GroceryManagementSystem.java
    java GroceryManagementSystem

🖼️ Screenshots

image image

💡 Concepts Demonstrated

  • CRUD operations (Create, Read, Update, Delete)
  • Database connectivity with MySQL
  • Parameterized queries and SQL security
  • Exception handling
  • Menu-driven console applications
  • Integration of Python and Java with the same database

⚙️ Default Configuration

Setting Value
Host localhost
Port 3306
User root
Password your_password
Database grocery_db

🧑‍💻 Author

  • Pushkar Gaikwad 🎓 SPPU | TE (AI & DS) LinkedIn Email
  • Aditya Yadav 🎓 SPPU | TE (AI & DS) LinkedIn Email
  • Yash Tongale 🎓 SPPU | TE (AI & DS) LinkedIn Email
  • Yash Zoman 🎓 SPPU | TE (AI & DS) LinkedIn Email

🪪 License

This project is open-source and available under the MIT License.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages