Skip to content

About

End-to-end customer churn analysis using SQL, Python, and Tableau with actionable retention insights.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#🏦IBM Telco Churn Analysis

Churn analysis on the classic IBM Telco Customer Churn dataset — light cleaning in Python, all the actual analysis in SQL, and a Tableau dashboard on top so the numbers are easy to slice by contract, payment method, and internet service.

##Pipeline: Python (cleaning) → MySQL (analysis) → Tableau (dashboard).

📊 Dashboard Preview

Dashboard

Dashboard public link

https://public.tableau.com/views/IBMchurnanalysisdashboard/Dashboard1?:language=en-GB&:sid=&:redirect=auth&:display_count=n&:origin=viz_share_link

📂 Dataset

ibm_telco_churn.csv — the standard IBM Telco dataset: customer ID, gender, senior citizen flag, partner/dependents, tenure, phone/internet service details, contract type, payment method, monthly/total charges, and churn label (7,043 customers).

📁 Project Structure

IBM-Churn-Analysis/ │ ├── Dashboard/ │ └── Customer_Churn_Dashboard.twb │ ├── Data/ │ ├── ibm_telco_churn.csv │ └── cleaned_file.csv │ ├── Images/ │ └── Dashboard.png │ ├── Python/ │ └── IBM_churn.ipynb │ ├── SQL/ │ └── customer_churn_analysis.sql │ ├── README.md └── .gitignore

##Step 1: Cleaning in Python Kept this light on purpose — just enough to make the SQL analysis clean:

-Lowercased all column names -Converted total_charges from text to numeric ,since there are some null values in the column -Dropped unnecessary columns (paperlessbilling, streamingtv, streamingmovies, deviceprotection, techsupport, onlinebackup, onlinesecurity) -Checked for duplicate rows and duplicate customer IDs — none found -Exported the result as cleaned_telco_churn.csv

##Step 2: SQL analysis (churn_ibm.sql) Cleaning/validation

-Renamed the imported table to telco_churn -Checked for blanks in TotalCharges- added a clean numeric column, and set it to 0 for customers with zero tenure (never billed) instead of null -(prefer 0 rather than null values )

##Sanity check ( quick and basic validation query ) on row count, remaining nulls, and churned vs retained split

-Churn rate by segment -Overall churn rate -By contract type, internet service, payment method -By tenure bucket (0-12, 13-24, 25-48, 48+ months) -Senior citizens vs non-seniors -Whether having TechSupport reduces churn

-Revenue impact Monthly revenue currently lost to already-churned customers Avg monthly and total charges, churned vs retained

##Window functions / ranking -Ranked churned customers by MonthlyCharges within each contract type -Running total of churned customers ordered by tenure -comparison of each customer's charges against the previous customer (by tenure) in the same contract group -Top 10 highest-value at-risk customers — month-to-month contract, still active, ranked by monthly charge -CTE isolating the "high-value, month-to-month" segment and its churn rate

##Step 3: 🔗 Interactive Tableau Dashboard

-KPI cards — Overall churn rate (26.54%), Total customers (7,043), Total revenue lost to churn (₹1,39,130.85), Avg customer tenure (32.37 months) -Churn Rate by Tenure Bucket — steep drop-off after the first year -Churn Rate by Internet Service — Fiber optic churns way more than DSL or no internet -Churn Rate by Contract Type — month-to-month vs one-year vs two-year -Churn Rate by Payment Method — electronic check stands out -Tenure vs Monthly Charges scatter, churned vs retained -Monthly Charges Distribution by Churn stacked bar -Filters for Contract, Payment Method, and Internet Service

📈 Key Insights

-Month-to-month contracts churn far more than locked-in ones — that gap alone (over 40% vs close to 2% for two-year contracts) makes contract type the single biggest churn lever in this dataset

-Fiber optic customers churn the most- by service type, well above DSL and customers with no internet — worth a closer look at fiber pricing or service quality

-Electronic check is the highest-churn payment method by a wide margin — customers on manual payment methods are more likely to leave than those on automatic ones

-Most churn happens early: the 0–12 month tenure bucket has by far the highest churn rate, so the first year is where retention effort matters most

-₹1,39,130.85/month is already walking out the door from churned customers — and the "top 10 high-value at-risk" query gives a concrete, actionable list of who to target next before they do the same

-Average tenure of 32.37 months across the whole base gives a baseline to measure any retention effort against

📌 Business Recommendations

  • Encourage customers to switch from Month-to-Month to One-Year or Two-Year contracts.
  • Improve the customer experience for Fiber Optic users.
  • Promote automatic payment methods with incentives.
  • Launch targeted retention campaigns during customers' first year.
  • Identify high-value customers showing churn signals and engage them with personalised offers.

Folder structure ├── data/

│ ├── ibm_telco_churn.csv

│ └── cleaned_telco_churn.csv

├── notebook/

│ └── IBM_churn.ipynb

├── sql/

│ └── churn_ibm.sql

├── tableau/

│ └── ibm_churn_dashboard.twb

└── README.md

-Running it : Run IBM_churn.ipynb on ibm_telco_churn.csv to produce cleaned_telco_churn.csv Import the cleaned file into MySQL and run churn_ibm.sql top to bottom Open ibm_churn_dashboard.twb in Tableau and point it at the SQL output

📬 Contact

Punit Kumar

GitHub: https://github.com/punitkumar-dtu


⭐ If you found this project useful, consider giving the repository a star.

About

End-to-end customer churn analysis using SQL, Python, and Tableau with actionable retention insights.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages