This project showcases advanced SQL techniques to explore customer churn patterns in the telecom industry. The dataset was originally in CSV format and imported into SQL Server for this analysis. https://public.tableau.com/app/profile/manuel.lizardo/viz/CustomerChurnAnalysis_17430403816220/CustomerChurnDashboard
To query and analyze churn data by segmenting customers, ranking them by revenue contribution, and preparing the data for future modeling.
- Microsoft SQL Server Management Studio (SSMS)
- Dataset format: CSV (converted to SQL table)
- Common Table Expressions (CTEs)
- CASE statements for conditional segmentation
- RANK() window function for customer charge ranking
- Joining CTEs for enriched feature engineering
- Order-based insights to support churn mitigation strategies
- Step 1: Use a CTE to create tenure-based customer segments (
New,Mid-Term,Loyal) - Step 2: Rank customers by
TotalChargesto identify high-revenue users - Step 3: Join CTEs to get a comprehensive churn report with enriched fields
| customerID | TenureGroup | MonthlyCharges | TotalCharges | ChargeRank | Churn |
|---|---|---|---|---|---|
| 7590-VHVEG | New | 29.85 | 29.85 | 1123 | No |
| 5575-GNVDE | Mid-Term | 56.95 | 1889.50 | 223 | No |
| ... | ... | ... | ... | ... | ... |
- telecom-churn-sql/Telecom-Churn.sql Full SQL script
- Build a churn prediction model using SQL or Python
- Feed this query into Tableau or Power BI for visual analysis
- Run A/B tests on the "New" customer segment to improve retention
Feel free to fork this project or connect with me on LinkedIn for collaboration or feedback!