Credit Risk & Banking Path · Mission 9 of 30Easy

Approval rate by FICO band

CASE aggregation to compute conditional percentages inside a GROUP BY

Back to Credit Risk & Banking

The Brief

Raj VenkatesanHead of Credit Strategycredit-strategy

Follow-up on the FICO distribution: I need the approval RATE by band, not just the volume. For each band, show the application count and the pct approved (rounded to 2 decimals). Same bands as the last query. Call the columns `fico_band`, `n_apps`, and `pct_approved`. Sort low-FICO to high.

You'll practice

CASE aggregationPercentagesLEFT JOIN

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

You already built the FICO bands in the previous mission. Now you need to add an approval rate column — think about how to express "what fraction of rows in this group met a condition" as a single aggregate expression.

Hint 2

Approval rate = fraction of apps where decision = 'Approved'. The idiomatic SQL: `AVG(CASE WHEN decision = 'Approved' THEN 1.0 ELSE 0 END) * 100`. Multiply by 100 to get a percentage, ROUND to 2 for a clean display.

Hint 3

Same band/order-by structure as the previous mission, plus a third column for approval rate. The AVG-of-CASE pattern from H2 collapses to a single aggregate per band — multiply by 100 and ROUND to 2 inside the SELECT.