AML & Fraud Analytics Path · Mission 9 of 30Easy

Customers with no KYC refresh in 3 years

IS NULL + date comparison to catch stale and missing KYC together

Back to AML & Fraud Analytics

The Brief

Aisha OkaforChief Compliance Officercompliance

Annual KYC refresh review. Return every customer whose `last_kyc_refresh` is NULL (never refreshed) OR older than 2023-04-24 (3+ years stale as of today). One row per customer: `customer_id`, `last_kyc_refresh`. Order by `last_kyc_refresh NULLS FIRST, customer_id`. This is what the examiners ask for first, every time.

You'll practice

LEFT JOINIS NULLDate math

Tables & columns available

aml_customersdim10 columns
ColumnTypeKey
customer_idINTPK
first_nameTEXT
last_nameTEXT
date_of_birthTEXT
emailTEXT
phoneTEXT
stateTEXT
statusTEXT
onboarded_dateTEXT
last_kyc_refreshTEXT

Hints (3)

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

Hint 1

`last_kyc_refresh` is stored as a TEXT date (`YYYY-MM-DD`). String comparison works correctly because the format is lexicographically-sortable — `'2023-01-27' < '2023-04-24'` is true.

Hint 2

Two conditions OR'd together: `last_kyc_refresh IS NULL OR last_kyc_refresh < '2023-04-24'`. The order matters for sort, but not for the filter itself.

Hint 3

Output covers both populations in one set: NULL refresh dates AND dates older than the cutoff. Order by last_kyc_refresh so NULLs and the oldest stale dates land together at the top.