Retail Banking Operations Path · Mission 16 of 30Hard

Monthly interest income by product category

Daily-balance × rate aggregation across two dimensions

The Brief

Jordan KimTreasurerretail-ops

ALCO follow-up. Build the input table for the NII decomposition: monthly interest income (or expense) by product category, Sep through Nov 2025. From `retail_balance_daily` joined to `retail_accounts` and `retail_products`, compute daily interest as `ledger_balance * interest_rate / 365.0`, sum it up per (month, category). Three columns: `month` (the integer 9, 10, 11), `category` (Deposit / Loan / Card), `interest_dollars` (rounded to 2 decimals). Sort by month, then category. Skip rows with NULL interest_rate.

You'll practice

Daily-balance × rate aggregation

Tables & columns available

retail_balance_dailyfact8 columns
ColumnTypeKey
snapshot_idINTPK
account_idINTFK → retail_accounts
snapshot_dateTEXT
ledger_balanceREAL
available_balanceREAL
interest_rateREAL
days_overdrawnINT
delinquency_statusTEXT
retail_accountsdim13 columns
ColumnTypeKey
account_idINTPK
customer_idINTFK → retail_customers
product_idINTFK → retail_products
branch_idINTFK → retail_branches
open_dateTEXT
close_dateTEXT
statusTEXT
ownership_typeTEXT
interest_rateREAL
original_balanceREAL
credit_limitREAL
fico_at_origINT
maturity_dateTEXT
retail_productsdim10 columns
ColumnTypeKey
product_idINTPK
product_codeTEXT
product_nameTEXT
categoryTEXT
subcategoryTEXT
default_aprREAL
default_apyREAL
monthly_feeREAL
nsf_feeREAL
od_feeREAL

Hints (3)

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

Hint 1

Daily interest accrual is `balance * rate / 365` — one number per (account, day). The monthly total per category is the SUM across all those daily rows after filtering.

Hint 2

Bucket by month with EXTRACT on the cast snapshot_date. Filter the briefing's date window in WHERE first so the SUM only includes the right months, and exclude rows where interest_rate is NULL (debit cards and some products carry no rate).

Hint 3

Two-dimensional GROUP BY — month and category. ROUND the dollar column to 2 decimals. ORDER BY month ascending, then category ascending.