Consumer Lending Analyst Path · Mission 8 of 30Easy

HMDA action_taken distribution

GROUP BY a HMDA-coded integer column with COUNT

The Brief

Rashida OkonkwoFair Lending Compliance Officerconsumer-lending

Standing Friday HMDA pre-check before I send anything to the LAR submission queue. Group `lending_applications` by `action_taken` and count rows. Two columns: `action_taken` (the integer code), `app_count`. Sort by action_taken ascending. The committee scans this every week — anything that looks off, we catch here.

You'll practice

GROUP BYCOUNT

Tables & columns available

lending_applicationsfact18 columns
ColumnTypeKey
app_idINTPK
customer_idINTFK → retail_customers
product_idINTFK → retail_products
application_dateTEXT
requested_amountREAL
requested_termINT
loan_purposeTEXT
action_takenINT
denial_reason_1INT
aus_recommendationTEXT
rate_spreadREAL
lien_statusINT
occupancyINT
ethnicityINT
raceINT
sexINT
age_bucketTEXT
property_tractTEXTFK → lending_geography

Hints (3)

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

Hint 1

Single-table aggregation. Group rows by the HMDA code column and count.

Hint 2

Leave the code as the raw integer — no CASE-based decoding. The LAR submission tool reads numeric codes, and the committee scans them at code-level too.

Hint 3

Sort the code ascending so the values list in order. Codes with zero rows simply won't appear in the result — that's a separate fair-lending question, not something to engineer around here.