This project focuses on analyzing business performance using SQL on a generated e-commerce dataset containing 20,000 records.
The goal was to apply advanced SQL concepts to solve practical business problems related to revenue, customers, regions, and product performance.
The dataset was created inside MySQL using SQL logic and includes:
- Order details
- Customer information
- Product details
- Region
- Sales and profit values
- Order dates
- database_setup.sql → Database creation and data generation
- business_analysis.sql → Core business KPI queries
- cte_queries.sql → Query using Common Table Expression (CTE)
- window_functions.sql → Advanced ranking and running total queries
- Aggregations (SUM, COUNT, AVG)
- GROUP BY and ORDER BY
- Common Table Expressions (CTE)
- Window Functions
- RANK(), DENSE_RANK(), ROW_NUMBER()
- PARTITION BY
- Running Totals
- Overall KPI summary
- Revenue by region
- Top customers by revenue
- Monthly revenue trend
- Profit margin by region
- Customer ranking comparison
- Top customers within each region
- Running total revenue
This project strengthened my understanding of writing structured analytical SQL queries and applying advanced SQL techniques to business scenarios.