Skip to content

Tripathi1997/SQL-E-Commerce-Analytics-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 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!

About

A comprehensive SQL analytics project solving real-world e-commerce business problems. Covers advanced concepts like cohort analysis, Pareto (80/20) revenue distribution, anomaly detection, and inventory optimization using SQL (CTEs, window functions, subqueries). Focused on deriving actionable business insights from structured datasets.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors