Introduction.
This project pretends to explore and make a diagnostic analysis of the customer churn of a bank and extract relevant and valuable insights for detecting and preventing future customer churn. It's broadly known that bringing new customers is more expensive than retaining the current ones, so this analysis will be crucial for improving the company's profit.
The main tool will be SQL, and just a few DataViz inside the same notebook to bring more clarity.
The dataset was taken from Kaggle: https://www.kaggle.com/datasets/radheshyamkollipara/bank-customer-churn
These are the 3 main questions that it pretends to answer:
- ¿What was the churn rate for the data given?
- ¿What could be the reasons for customers to decide to quit?
- ¿Is there anything the bank can do to avoid customer churn?
In the Key insights and recommendations, you can find the key takeaways of this analysis without any process, it's a quick view and valuable summary of the findings.
In the Queries and process, you will find the complete process and queries used to find the insights from scratch and a more detailed explanation.
In the Good to know, you can see other interesting but not much relevant findings and measures taken from the dataset.
Here is a snapshot of the dataset used:
Key insights and recommendations.
What does NOT have an impact:
What does have an impact:
Recommendations
Queries and process
¿What is the churn rate for the data given?
Churn rate = 20.38%
To get this, I counted the customers grouped by the “Exited” field, which says “True” for the customers who ended the relationship with the company and “False” for customers who didn’t, and calculated the percentage of each one.
¿What can be the reason customers decide to quit?
To address and answer this question it’s necessary to start by creating a hypothesis and check the data to see if the hypothesis is true or not. Below it’s listed the facts that may influence the customer’s loyalty and that can be taken into account to generate the hypothesis:
- Credit score - Tenure - Balance - Number of products - Credit card owning - Activeness - Estimated salary - Complaint - Satisfaction score - Card type - Points earned
Then will be necessary to analyze each field compared with the churn to see if there is any pattern or relationship.
To answer this question, I’m going to compare the field “Exited” with each field that can affect customer loyalty.
Are the customers with a high credit score more likely to stay with us and the ones with a low score more likely to quit? Or vice-versa?
No, the customers have gone and have stayed by very similar percentages according to their credit scores. A high score doesn't imply higher odds of staying or quitting; on the flip side, a lower score doesn't mean more odds of quitting or staying.
To get a snapshot of the scores:
As we can see, the average credit score doesn't strongly relate to the churn. The 20.38% of customers who decided to quit had similar average credit scores to those who didn't. The max and min credit scores for both were also similar, but I will dive deeper into this:
Now, I will rank the credit scores by FICO Score Ratings:
Exceptional: 800 to 850 Very Good: 740 to 799 Good: 670 to 739 Fair: 580 to 669 Very Poor: 300 to 579
¿How many customers with exceptional credit scores have gone?
With these numbers, we see that the customers with exceptional credit scores who have gone represent only 6.28% of the total customers who have gone.
¿And the ones with very good credit scores?
The participation of customers with very good credit scores in the total churn is 12.41%, double of the customers with exceptional credit scores.
¿Good credit scores who have gone?
The amount of customers continues rising, with this category at 22.18%
¿What about the customers with fair credit scores?
It keeps going up, now with 33.61% of the total churn.
¿And the ones with very poor credit scores, in the total churn?
The customers with the lowest credit category are 25.52% of the total churn.
The customers with fair credit scores represent the more significant portion of the churn with 33.61%, followed by the customers with very poor credit scores with a percentage of 25.52%, the third place is the customers with good credit scores with 22.18%, then the ones with very good credit scores with 12.41% and finally the exceptional credit scores with just a 6.28%.
This shows us a trend, but we need to be mindful of the percental distribution of the credit scores with all the customers and not only with the exited ones because if the trend looks similar to one generated by the customers who still are active, then the trend generated by the churned customers would not meaning anything. Let's see the trend with all the customers.
The number of customers with the same score category who have gone is proportional to the ones who haven't. It means that a high or low credit score is not the main reason for the quit.
¿Are our customers more likely to quit when they are relatively new and more likely to stay with us when they are tenured?
The churn was not significantly different between the tenures; almost all the 10 tenures represent percentages around 10%, which shows a similar distribution; however, there are 2 outliers, and actually, they are the top and the bottom of tenures, but the same is true for the customers who didn't quit so it's just an expected outlier, and we can conclude the tenure does not play an important role in the decision to quit.
To resolve this, I bring the count and percentage of customers who quit segmented by their tenure.
The data shows a reduction in exited customers when they have less than a year and when they have 10 years; now let's see if that reduction is present in the customer who didn't quit.
The percentages remain slightly similar.
¿Does the balance in the customer's account influence their decision to quit?
The customers left indistinctly of the account balance. There are no certain account balances where the customers quit at a higher or lower rate.
In the following query, we can see the customer count by account balance. A normal distribution is present in the total count as well as in the churn count:
¿The more products the customer has, the less likely to quit?
100% of the customers with 4 products quit, and 82.71% of customers with 3 products quit; however, those 2 categories represent less than 14% of the churn, so it would be nice to look into and fix it, but the greatest impact would be the category of 1 product as it represents 69.14% of the total churn.
Count by the number of products of all customers:
Count by the number of products of exited customers, the percentage of the total customers, and the total churn.
¿Were the exited customer credit card owners?
The exited customers had credit cards in the same proportion as those who didn't quit, keeping the number around 70% with credit cards.
¿Were the churned customers active members?
63.94% of the churn were inactive members, while the remaining 36.06% were active members.
¿Were the customers with a certain range of salaries more likely to quit?
The churn rate was relatively consistent across the different salary ranges so it does not represent an important fact in this review.
To see the range of salaries in the whole dataset:
Creating the salary ranges to analyze the churn:
¿Do complaints influence churn?
Complaints play a crucial role in churn. 99.80% of churned customers filed a complaint. Likewise, 99.87% of customers that stayed with us have never complained.
¿Did customer satisfaction influence churn?
The churn was equal across the 5 satisfaction scores, so it does not represent a critical factor.
¿Had the exited customers a certain card type?
No, the customers who have gone had different card types in pretty similar proportions.
¿Do customers with a high amount of points not quit?
Not necessarily. The churn was equal across the different ranges of points earned, so it does not play a relevant role in the churn.
To see the whole range of points earned:
Creating ranges to segment the count:
Good to know
Churn by gender:
Out of the total number of people who left, 55.89% were women and 44.11% were men.
Churn by country:
Spain has the lowest churn, while France and Germany have almost 40% with 39.79% and 39.94% respectively.