π eCommerce Sales Data Analysis using MySQL
Welcome to my SQL-based data analysis project where I dive deep into sales trends, customer behavior, product performance, and order insights using a self-created eCommerce database. This project was developed as part of my Data Analyst internship to simulate real-world retail data problems and solve them through SQL.
π¦ Dataset: ecommerce_big
This project revolves around a mock eCommerce platform database that closely resembles platforms like Amazon, Flipkart, or Shopify. The database includes 4 core tables:
| Table Name | Description |
|---|---|
customers |
Contains customer details like name and email |
products |
Product catalog with names, categories, and price |
orders |
Transaction data including order dates and IDs |
order_items |
Line items of each order: quantity & product info |
π· Screenshots showing the structure of these tables can be found in the screenshots/ folder.
βοΈ Technologies Used
- MySQL Workbench β SQL Querying and database creation
- SQL (DDL + DML + Queries) β Data definition and data manipulation
- Windows 11 β Local development environment
π― Objectives
The core aim of this project was to:
- Understand how relational databases work in an eCommerce context
- Perform data extraction, transformation, and analysis via SQL
- Gain practical experience with real-world business scenarios
π Key Analytical Tasks
Each SQL file addresses a key eCommerce metric or analysis scenario, such as:
- π Top-selling products
- π₯ Repeat customers
- πΈ Total revenue by date/category
- π¦ Average items per order
- π΅οΈββοΈ Customer insights
These were done using advanced SQL techniques like:
JOINsGROUP BYHAVING,WHERE- Subqueries & Nested Selects
- Aggregate functions (
SUM,COUNT,AVG)
π§ Business Insights Extracted
A few real-world learnings simulated from this dataset:
- High-value customers contribute to a large chunk of sales β supporting Paretoβs 80/20 rule.
- Certain products consistently outperform in terms of both units sold and revenue β useful for inventory planning.
- Order quantity patterns indicate bulk purchasing behavior during specific periods (e.g., festive seasons).
π Files in this Repo
| File Name | Description |
|---|---|
task3_queries.sql |
All SQL queries written during the analysis |
README.md |
Project overview and context |
screenshots/ |
MySQL Workbench screenshots for submission |
π Notes
- The database was manually built using raw SQL (DDL + DML) to simulate a real-world eCommerce schema.
- All screenshots are included to validate the structure and execution of each query.
- The project assumes one order can have multiple items (i.e., 1-to-many relationship between
ordersandorder_items).
π¨βπ» Author
Somya Sinha Aspiring Data Analyst | SQL Enthusiast | Excel & Power BI Learner
π www.linkedin.com/in/somyasinha100 π§ somyasinha615@gmail.com
π¬ βData is the new oil. SQL is the engine that refines it.β
β Inspired by real-world analysts building smarter ecommerce systems