Skip to content

Latest commit

 

History

History
124 lines (80 loc) · 2.69 KB

File metadata and controls

124 lines (80 loc) · 2.69 KB

📊 SQL E-Commerce Analytics Project

SQL Analytics Project

Solving 45 real-world e-commerce business problems using SQL 🚀


🔍 Overview

This project demonstrates end-to-end data analysis using SQL on an e-commerce dataset. It focuses on deriving actionable business insights using advanced SQL techniques.


🚀 Key Highlights

  • 📈 Customer Retention using Cohort Analysis
  • 💰 Revenue Optimization using Pareto (80/20) Analysis
  • ⚠️ Detection of abnormal patterns via Anomaly Detection
  • 📦 Inventory performance using Turnover Analysis
  • 🧠 Advanced SQL using Window Functions & CTEs

🧠 Concepts Covered

  • Joins & Aggregations
  • Subqueries & CTEs
  • Window Functions (RANK, ROW_NUMBER, NTILE)
  • Cohort Analysis
  • Pareto Analysis
  • KPI Metrics (AOV, Revenue, Retention)

📊 Key Business Insights

  • 🔥 Top 20% products contribute ~80% of total revenue
  • 📉 Customer retention drops significantly after Month 1
  • 📦 Identified slow-moving inventory using turnover ratio
  • ⚠️ Detected high-quantity anomalies in orders

📂 Project Structure

sql-ecommerce-analytics/
│
├── easy/        # Basic SQL queries
├── medium/      # Business logic problems
├── hard/        # Window functions & analytics
├── advanced/    # Cohort, Pareto, anomalies
├── datasets/    # Schema & sample data
└── docs/        # Explanations & notes

🗺️ Data Model

This ER diagram represents relationships between customers, orders, products, inventory, and logistics systems.

ER Diagram


⚙️ Tech Stack

  • SQL (MySQL)
  • Excel (Power Query, VBA)
  • (Optional) Power BI

🧪 How to Run

  1. Execute schema.sql
  2. Insert sample data
  3. Run queries from each folder

📸 Preview

(Add screenshots here for better impact)

  • Cohort retention table
  • Pareto revenue distribution
  • Query outputs

💡 Business Impact

  • Identifies high-value customers and products
  • Helps optimize inventory and reduce dead stock
  • Detects anomalies in ordering patterns
  • Supports data-driven decision-making

🏷️ Tags

SQL • Data Analysis • Power BI • Cohort Analysis • Business Intelligence


👨‍💻 Author

Shubham Tripathi Data Analyst | SQL | Business Analytics


⚠️ Note

This repository is for learning and reference purposes. Direct modifications are restricted.


⭐ If you found this useful, consider giving it a star!