Credit Risk & Banking Path · Mission 8 of 30Easy

FICO band distribution at origination

CASE WHEN bucketing combined with GROUP BY for a categorical distribution

Back to Credit Risk & Banking

The Brief

Raj VenkatesanHead of Credit Strategycredit-strategy

Before I can answer the CEO's question about portfolio mix, I need the FICO distribution of everyone who's ever applied. Bucket `fico_at_app` into `<600`, `600-639`, `640-679`, `680-719`, and `720+`. Show band name and application count. Sort by the FICO lower bound ascending — so `<600` is on top, `720+` at the bottom.

You'll practice

CASE WHENGROUP BY

Tables & columns available

banking_applicationsfact9 columns
ColumnTypeKey
app_idINTPK
customer_idINTFK → banking_customers
product_typeTEXT
app_dateTEXT
decisionTEXT
fico_at_appINT
offered_aprREAL
approved_limitREAL
booked_account_idINTFK → banking_accounts

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

CASE WHEN with 5 thresholds, ELSE for the top band.

Hint 2

To sort by FICO lower bound without hardcoding, add `MIN(fico_at_app)` to ORDER BY — it works even though it's not in the SELECT list.

Hint 3

GROUP BY the band column, COUNT(*) for the app volume, and use MIN(fico_at_app) in the ORDER BY so the bands sort by their numeric lower bound rather than alphabetically.