A complete SQL data analysis project built on a real-world e-commerce inventory dataset inspired by Zepto's product catalog. This project demonstrates practical SQL skills used in retail and e-commerce analytics, including database creation, data cleaning, exploratory data analysis (EDA), and business insight generation.
This repository was created as part of my SQL portfolio to showcase problem-solving, analytical thinking, and PostgreSQL skills commonly expected from Data Analysts and SQL Developers.
The objective of this project is to simulate the daily responsibilities of a Data Analyst by working with a real inventory dataset.
The project covers:
- Designing a PostgreSQL database
- Importing raw CSV data
- Exploring and validating the dataset
- Cleaning inconsistent records
- Writing analytical SQL queries
- Generating business insights for inventory and pricing decisions
The dataset contains inventory information from an online grocery and quick-commerce platform.
Each record represents a unique SKU (Stock Keeping Unit).
| Column | Description |
|---|---|
| sku_id | Unique Product ID |
| name | Product Name |
| category | Product Category |
| mrp | Maximum Retail Price |
| discountPercent | Discount Percentage |
| discountedSellingPrice | Final Selling Price |
| availableQuantity | Available Inventory |
| weightInGms | Product Weight |
| outOfStock | Stock Availability |
| quantity | Package Quantity |
- PostgreSQL
- pgAdmin 4
- SQL
- CSV Dataset
- Git
- GitHub
A PostgreSQL table was created with appropriate data types to efficiently store inventory information.
Key considerations included:
- Primary Key creation
- Numeric data types for pricing
- Boolean values for stock status
- Integer values for inventory and weight
The dataset was imported into PostgreSQL using pgAdmin.
During import:
- CSV encoding issues were resolved by converting the file to UTF-8.
- Column mapping was verified before loading.
- Data integrity was validated after import.
Several exploratory queries were performed to understand the dataset.
These included:
- Total number of products
- Category distribution
- Distinct product categories
- Duplicate product names
- Null value detection
- Stock availability analysis
- Product pricing overview
To improve data quality, the following cleaning steps were performed:
- Removed invalid rows with zero pricing
- Standardized price values
- Converted prices from paise to rupees
- Verified missing values
- Checked for inconsistent records
The project answers several practical business questions using SQL.
Some of the analyses include:
- Top products offering the highest discounts
- High-value products currently out of stock
- Estimated inventory value by category
- Premium products with low discounts
- Categories providing the highest average discounts
- Best value products based on price per gram
- Product segmentation by weight
- Total inventory weight by category
This project demonstrates practical usage of:
- SELECT
- WHERE
- ORDER BY
- GROUP BY
- HAVING
- DISTINCT
- LIMIT
- CASE WHEN
- Aggregate Functions
- Arithmetic Operations
- Common Filtering Techniques
- Data Cleaning Queries
├── dataset/
│ └── zepto_inventory.csv
│
├── sql/
│ └── zepto_inventory_analysis.sql
│
├── screenshots/
│ ├── query_results/
│ └── database_schema/
│
└── README.md
- SQL Query Writing
- Data Cleaning
- Exploratory Data Analysis
- Inventory Analysis
- Retail Analytics
- Business Intelligence
- PostgreSQL
- Database Design
- Analytical Thinking
Through this project I gained hands-on experience in:
- Working with real-world datasets
- Cleaning and validating raw data
- Writing optimized SQL queries
- Performing business-oriented analysis
- Organizing SQL projects for GitHub portfolios
Possible future enhancements include:
- SQL Views
- Stored Procedures
- Window Functions
- Index Optimization
- Dashboard creation using Power BI
- PostgreSQL Performance Optimization
The dataset is based on publicly available Zepto inventory data originally shared on Kaggle.
Harsh Yadav
MCA Graduate | Aspiring Database Administrator (DBA) | SQL & PostgreSQL Enthusiast
- SQL
- PostgreSQL
- MySQL
- Python
- Excel
- Database Design
⭐ If you found this project helpful, feel free to star the repository.