Skip to content

77019ashu/Ecommerce-SQL-Analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š E-Commerce Sales & Customer Analytics (SQL Project)

πŸ“Œ Project Overview

This project performs end-to-end SQL analysis in a Brazilian e-commerce dataset to extract meaningful business insights related to revenue performance, product trends, customer behavior, and customer segmentation.

The objective of this project is to simulate real-world business analytics tasks using MySQL and advanced SQL techniques.


πŸ›  Tools & Technologies Used

  • MySQL Workbench
  • SQL (Joins, Aggregations, Subqueries)
  • Window Functions (NTILE)
  • CASE Statements
  • RFM Customer Segmentation
  • Git & GitHub

πŸ“ˆ Business Problems Solved

  1. Calculated total revenue generated by the business.
  2. Measured average order value (AOV).
  3. Analyzed monthly revenue trends.
  4. Identified top-performing products.
  5. Identified top-performing product categories.
  6. Calculated revenue contribution percentage by category.
  7. Measured repeat customer rate.
  8. Identified top-spending customers.
  9. Segmented customers using RFM analysis.

πŸ“Š Key KPIs Calculated

  • Total Revenue
  • Average Order Value (AOV)
  • Monthly Revenue Trend
  • Top 10 Products by Revenue
  • Top 10 Categories by Revenue
  • Revenue Contribution %
  • Repeat Customer Rate
  • Customer Lifetime Spend
  • RFM Scores (Recency, Frequency, Monetary)
  • Customer Segment Distribution

🧠 RFM Segmentation Strategy

Customers were segmented using:

  • Recency β†’ Days since last purchase
  • Frequency β†’ Number of completed orders
  • Monetary β†’ Total spending amount

Using NTILE(5) window function, customers were scored from 1 to 5 and classified into the following segments:

  • Champions
  • Loyal Customers
  • Potential Loyalists
  • At Risk
  • Others

πŸ“Œ Key Insights

  • Revenue is concentrated among a small percentage of customers.
  • Only ~0.4% of customers are classified as Champions.
  • Around 34% of customers are Potential Loyalists, representing strong growth opportunity.
  • Approximately 11% of customers are At Risk and require retention strategies.
  • Repeat customer rate is relatively low (~3%), indicating opportunity for loyalty programs.
  • Top product categories contribute a significant share of overall revenue.

πŸ’‘ Business Recommendations

  • Launch targeted marketing campaigns for Potential Loyalists.
  • Retarget At Risk customers using personalized discounts.
  • Develop loyalty programs to improve repeat purchase rate.
  • Focus marketing efforts on high-performing product categories.
  • Create retention strategies for high-monetary customers.

πŸ“‚ Dataset

Brazilian E-Commerce Public Dataset (Olist).


🎯 Skills Demonstrated

  • Advanced SQL Querying
  • Data Aggregation & Joins
  • Window Functions
  • Customer Segmentation (RFM)
  • KPI Development
  • Business Insight Generation
  • Analytical Thinking

πŸš€ Project Outcome

This project demonstrates the ability to transform raw transactional data into structured business insights using SQL and apply analytical techniques to support strategic decision-making.

About

End-to-End SQL E-commerce Analytics project including revenue analysis, customer segmentation (RFM), and KPI insights.

Topics

Resources

Stars

Watchers

Forks

Contributors