Retail Banking Operations Path · Mission 15 of 30Hard

Onboarding funnel: 90-day primary-relationship rate

Cohort CTE with within-window EXISTS

The Brief

Sarah ReyesCustomer Insights Leadretail-ops

Quarterly onboarding funnel review. Pull every Checking account opened in Q3 2025 (open_date 2025-07-01 through 2025-09-30) and bucket by `acquisition_channel`. For each channel, show `cohort_size`, `converted` (count of accounts that had at least one ACH-In transaction with `counterparty_name LIKE '%PAYROLL%'` within 90 days of opening), and `conversion_pct` (converted/cohort_size * 100, rounded to 1 decimal). Sort by acquisition_channel ascending.

You'll practice

Cohort CTEWithin-window EXISTS

Tables & columns available

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
retail_customersdim13 columns
ColumnTypeKey
customer_idINTPK
household_idTEXT
first_nameTEXT
last_nameTEXT
date_of_birthTEXT
stateTEXT
segmentTEXT
fico_currentINT
estimated_incomeREAL
kyc_riskTEXT
acquisition_channelTEXT
onboarded_dateTEXT
statusTEXT
retail_transactionsfact12 columns
ColumnTypeKey
txn_idINTPK
account_idINTFK → retail_accounts
branch_idINTFK → retail_branches
post_dateTEXT
channelTEXT
transaction_typeTEXT
debit_creditTEXT
amountREAL
descriptionTEXT
counterparty_nameTEXT
is_cash_flagINT
is_reversalINT

Hints (3)

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

Hint 1

Build a cohort CTE: pick the Checking-account openings in the Q3 2025 window and carry `acquisition_channel` (from `retail_customers`) and `open_date` along. The 90-day window slides per-account, so you need each account's open_date on the row before the EXISTS check.

Hint 2

The conversion check is an EXISTS subquery on the transactions table — same account, payroll counterparty pattern, post_date inside the per-account 90-day window starting at open_date. Cast date columns as needed for the interval arithmetic.

Hint 3

GROUP BY acquisition_channel. Cohort size from COUNT(*), converted from a SUM of a 0/1 CASE on the EXISTS, rate as converted / cohort × 100 rounded to 1. Multiply by 100.0 (not 100) to force float math.