π° Customer Intelligence Analytics Banking - Part 2
βοΈ SQL Queries & First Insights
After expanding the dataset to 100,000 customers, it was time to dig deeper and run real queries on the data; I needed to understand who these customers are, what their behaviors look like, and how they interact with the bankβs products and services.
β½ Main Goals
Write SQL queries for customer segmentation, loan analysis, and credit card health
Investigate key metrics like loan default risk and credit card utilization
Identify high-value customers for retention and upsell: first drawn for the call to action
π Step by Step
π Step 1: Wrote the customer segmentation query to analyze customer types (age, account type, balance, risk profile)
π Step 2: Created a loan analysis query to identify credit risks of the bank
π Step 3: Built a credit card usage query to spot high-risk users
π Step 4: Validated first query results
π Key Insights
The queries provided a glimpse into the bankβs risk exposure and allowed me to start thinking strategically about customer retention.
For example, the loan analysis revealed a higher-than-expected rejection rate in the personal loan segment, which needs immediate attention.
βοΈ Code Snippet: SQL Queries
SELECT
loan_status,
loan_type,
COUNT(*) as num_loans,
ROUND(AVG(loan_amount)::numeric, 2) as avg_loan_amount,
ROUND(SUM(loan_amount)::numeric, 2) as total_loan_portfolio,
ROUND(AVG(interest_rate)::numeric, 2) as avg_interest_rate
FROM customer_data
π Bar Chart: Credit Type and Status
The Barplot shows the credit segmentation, splitted between loans, personal and auto and the status (accepets, closed or rejected). All generated by tableau, uploading the Query output.
π― Next Steps
Running the last SQL queries on the expanded dataset, focusing on customer demographics, default risk and picking high-value customers Starting the Tableau Dashboard design for the Data Visualization