Retail Banking Operations Path · Mission 13 of 30Medium

Average daily balance for fee waivers

AVG over a daily-balance snapshot window

The Brief

Priya DesaiBranch Operations Managerretail-ops

Monthly maintenance fees are about to assess. The waiver threshold on Total Checking is $1,500 ADB for the calendar month — I need the list of accounts that fell short in October 2025 so the call center can outreach before the fee posts. From `retail_balance_daily`, compute average ledger balance per account for snapshot dates from 2025-10-01 through 2025-10-31. Return `account_id` and `adb_oct` (rounded to 2 decimals) for accounts where the ADB is strictly below $1,500. Sort ADB ascending.

You'll practice

AVG over windowSnapshot fact

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

Hints (3)

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

Hint 1

Daily balance is one row per (account, date). The 'average daily balance' is just AVG(ledger_balance) grouped by account, with the date window filtered in WHERE.

Hint 2

Filter `snapshot_date BETWEEN '2025-10-01' AND '2025-10-31'` before the GROUP BY so the AVG only reflects October. Round the result to 2 decimals to match the dollar-display convention.

Hint 3

After the GROUP BY, gate on the threshold with HAVING (the average is an aggregate). Strict less-than against the briefing's $1,500 waiver threshold keeps only the accounts that fell short.