AML & Fraud Analytics Path · Mission 6 of 30Easy

Sub-$10K cash deposits by customer

GROUP BY + HAVING to surface customers structuring below a reporting threshold

Back to AML & Fraud Analytics

The Brief

Teresa ReyesBSA Officerbsa-reporting

New question for the Feb 2025 review. For each customer, count their cash deposits in February where the amount was strictly below $10,000 — that's the structuring zone. Return customer_id + the count, but only for customers with at least 3 such deposits in February. Order by the count descending. Exclude reversals. I'm looking for the short list, not every customer who made a single deposit.

You'll practice

GROUP BYHAVINGStructuring hint

Tables & columns available

aml_transactionsfact9 columns
ColumnTypeKey
txn_idINTPK
account_idINTFK → aml_accounts
posted_dateTEXT
posted_tsTEXT
amountREAL
channelTEXT
counterparty_nameTEXT
counterparty_account_idINT
is_reversalINT
aml_accountsdim6 columns
ColumnTypeKey
account_idINTPK
customer_idINTFK → aml_customers
product_typeTEXT
open_dateTEXT
close_dateTEXT
statusTEXT

Hints (3)

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

Hint 1

Join `aml_transactions` to `aml_accounts` on `account_id` so you can group by customer, not by account. A customer can have 3 accounts — you want one row per customer.

Hint 2

Three filters in WHERE: cash channel, non-reversal, amount strictly below 10K. Then narrow to February 2025 by date range. GROUP BY customer_id and HAVING the deposit count is at least 3.

Hint 3

Result is short — structuring is rare relative to legitimate sub-10K deposits, so a tight result set means the filter is doing its job.