ArpitaRandive/Customer-Churn-Revenue-Analysis-SQL-Project-
End-to-end SQL project analyzing customer churn and revenue using transactional sales data. The project applies SQL joins, aggregations, CTEs, and window functions to classify customers into Active, Churned, and Never Converted segments, with results visualized in Power BI.
๐ Customer Churn & Revenue Analysis โ SQL Project
An end-to-end SQL analytics project analyzing customer churn, revenue trends, and lifetime value from transactional sales data โ visualized in Power BI.
๐ Project Overview
This project simulates a real-world analytics workflow where SQL is the primary tool for data extraction, transformation, and analysis. It covers revenue performance, customer lifecycle segmentation, and churn identification โ all built on a normalized relational database.
๐ฏ Objectives
- ๐ Analyze overall and monthly revenue performance
- ๐๏ธ Understand customer purchasing behavior
- ๐ Classify customers into lifecycle segments
- ๐ Identify high-value customers and top-performing products
- ๐ฐ Calculate Average Order Value & Customer Lifetime Value (LTV)
- ๐ Prepare SQL outputs for BI visualization
๐๏ธ Data Model
A normalized relational schema ensuring data integrity and analytical flexibility.
| Table | Description |
|---|---|
Customers |
Customer details and signup information |
Products |
Product names, categories, and pricing |
Orders |
Order-level data including dates and status |
Order Items |
Line-item details โ quantity and item price |
Relationships:
- One customer โ Many orders
- One order โ Many products
- One product โ Many orders
๐น Revenue Analysis
Key analyses performed:
- โ Total revenue from all completed transactions
- โ Monthly revenue trends (growth, decline, seasonality)
- โ Month-over-month revenue change
- โ Revenue by customer (top contributors)
- โ Revenue by product and category
๐ฅ Customer Behavior Analysis
Examining order frequency, recency, and total spending to identify:
- One-time vs repeat customers
- High-frequency purchasers
- Top revenue-contributing customers
๐ Customer Lifecycle Segmentation
Customers classified into 3 lifecycle segments:
| Segment | Definition |
|---|---|
| โ Active | Completed order within recent time window |
| Last purchase beyond inactivity threshold | |
| โ Never Converted | Signed up but never placed a completed order |
Classification is based on last completed order date โ a standard industry approach for churn analysis.
๐ Customer Lifetime Value (LTV)
Total revenue generated per customer across all completed purchases.
Business use cases:
- Identify high-value customers
- Analyze revenue concentration
- Support retention and targeting decisions
๐ Power BI Dashboard
All business logic lives in SQL. Results are visualized in Power BI with:
- ๐ KPI summaries (customer counts, churn rate, revenue)
- ๐ Monthly revenue trend analysis
- ๐ Revenue breakdown by customer and product
- ๐ฅ Customer count by lifecycle status
Customers with no transactions are excluded from revenue visuals but included in customer count metrics for accurate business representation.
๐ ๏ธ SQL Techniques Used
JOINโ linking customers, orders, productsCTE(Common Table Expressions) โ modular query designWindow Functionsโ ranking, running totals, lag/leadAggregationsโ revenue, frequency, LTV calculationsCASEstatements โ lifecycle classification logic
๐ How to Use
- Execute SQL scripts to create tables and populate data
- Run analytical queries from the provided SQL files
- Review query outputs or load into Power BI for visualization
- Explore insights on revenue, churn, and customer behavior
๐ก Key Learnings
- SQL can power end-to-end analytical workflows without additional tools
- Distinguishing transactional vs non-transactional customers is critical
- Churn logic can be implemented using simple, explainable rules
- Relational data modeling enables flexible, scalable analysis
- SQL + Power BI is a powerful combo for business intelligence
๐ฎ Future Enhancements
- Add cohort-based churn tracking
- Incorporate RFM (Recency, Frequency, Monetary) scoring
- Build stored procedures for automated reporting
- Connect live database to Power BI for real-time dashboards
Made with โค๏ธ by Arpita Randive