Open specification · churn-dashboard-fix · v2Fix the Broken Churn Dashboard
The board has been shown the wrong churn rate for months. Find out why, and fix the query.
The brief
You are the analyst at Tallyo, a subscription software company. The product manager has been reporting June's churn rate from the query below, and finance thinks the number is wrong.
subscriptions.csv has one row per subscription: when it started, when it was cancelled (empty if still live), its plan and its monthly fee. When a customer upgrades, their old subscription is cancelled and a new one starts the same day. customers.csv has one row per customer, and a few customers have no region on record.
The company's definitions: a subscription is active on a date D when started_on ≤ D and (cancelled_on is empty or cancelled_on > D). A customer is active at the start of June if they had an active subscription on 31 May 2025. A customer churned in June if they were active on 31 May 2025 and had no active subscription on 30 June 2025. Churn rate = churned customers ÷ customers active at the start of June.
Load the two files into any SQL engine you like (DuckDB, SQLite or Postgres all work) and run the query as written before you change it.
The data
Every candidate gets their own copy, generated from their attempt's seed. Below is the first few rows from public example seed 20260101; a candidate's numbers will differ.
| subscription_id | customer_id | plan | monthly_fee | started_on | cancelled_on |
|---|---|---|---|---|---|
| S1 | C00001 | Plus | 19 | 2025-06-06 | ∅ |
| S2 | C00002 | Basic | 9 | 2024-07-04 | 2025-05-25 |
| S3 | C00003 | Basic | 9 | 2024-05-21 | ∅ |
| S4 | C00004 | Basic | 9 | 2024-07-10 | 2025-04-03 |
| S5 | C00005 | Basic | 9 | 2024-04-10 | 2024-12-31 |
| S6 | C00006 | Basic | 9 | 2024-01-31 | 2025-01-16 |
| customer_id | signup_channel | region |
|---|---|---|
| C00001 | Paid search | Germany |
| C00002 | Paid search | UK |
| C00003 | Paid search | Ireland |
| C00004 | Organic | Netherlands |
| C00005 | Referral | Netherlands |
| C00006 | Paid search | Ireland |
-- churn_dashboard.sql: "June churn rate"
SELECT
COUNT(*) FILTER (
WHERE s.cancelled_on BETWEEN '2025-06-01' AND '2025-06-30'
) * 100.0 / COUNT(*) AS churn_rate_pct
FROM subscriptions s
JOIN customers c ON c.customer_id = s.customer_id
WHERE s.started_on < '2025-06-01'
AND c.region IS NOT NULL
AND c.region <> '';The tasks
Weights are shares of the simulation score (total 9.5). Each task names the competencies it evidences and how strongly.
- 1. Run it as writtenA number from your data · weight 1
Run the dashboard query exactly as written. What churn rate does it report? Give a percentage to two decimal places.
Tolerance: ±0.02 points
Evidences: SQL ×1
- 2. What is actually wrongSelect all that apply · weight 2
Given the company's definitions, which of these are real problems with the query?
- ○It counts subscriptions rather than customers, so upgrades (one subscription ends and another starts) are counted as churn
- ○The denominator includes subscriptions that had already been cancelled before June
- ○Customers with no region on record are dropped from both the numerator and the denominator
- ○BETWEEN excludes cancellations made on 30 June
- ○Multiplying by 100.0 before dividing gives the wrong answer
- ○started_on < '2025-06-01' wrongly excludes subscriptions that started on 31 May
Evidences: SQL ×1 · Data analysis ×0.5 · Critical thinking ×0.5
- 3. The right numberA number from your data · weight 2
What was June 2025's churn rate, correctly calculated? Give a percentage to two decimal places.
Tolerance: ±0.05 points · confidence asked before reveal
Evidences: SQL ×1 · Data analysis ×1
- 4. What it costA number from your data · weight 1
How much monthly recurring revenue was lost to June churn? Sum the monthly_fee of the subscription each churned customer held on 31 May. Whole pounds.
Tolerance: ±0.5
Evidences: Data analysis ×1 · SQL ×0.5
- 5. The corrected queryCode · weight 2
Write the corrected query. It should return June 2025's churn rate using the company's definitions.
Evidences: SQL ×1
Rubric line Weight Full marks (4/4) looks like Counts customers 35% Works at customer level, so an upgrade (old subscription cancelled, new one active on 30 June) is not churn. Right denominator 30% Only customers with a subscription active on 31 May count in the denominator. Nobody dropped 20% No join or filter silently removes customers without a region. Readable 15% Named CTEs for 'active at start' and 'active at end', or equivalent clarity. - 6. Tell the product managerWritten · weight 1.5
The product manager has been reporting the old number to the board. Write them a short note: what was wrong, what the right number is, and what they should do about the months already reported.
Evidences: Communication ×1 · Business analysis ×0.5
Rubric line Weight Full marks (4/4) looks like Clear about what was wrong 35% Explains the errors in plain words, without blame or jargon. Gives the right number 30% States the corrected rate and how far off the old one was. Recommends action 35% Recommends restating earlier months with the fixed query and saying so to the board.
The defence
After submitting, candidates answer these against the clock, typed live. Prompts quote the candidate's own submission where shown in brackets.
- D1. Explain your work5 min
This is your corrected query: [the candidate's own answer to "The corrected query"] A customer upgraded from Basic to Plus on 12 June. Walk through how your query treats them, and why they are not counted as churned.
Rubric line Weight Full marks (4/4) looks like Traces their own query 60% Follows the customer through the actual logic they submitted. Correct conclusion 40% Correctly identifies the step that keeps an upgrade out of the churned count (or admits their query would count it). - D2. Modify it5 min
The board now wants churn for every month of 2025 in one result, one row per month. What would you change in your query?
Rubric line Weight Full marks (4/4) looks like Month series 50% Generates or derives one row per month (generate_series, a calendar CTE, or equivalent). Per-month boundaries 50% Replaces the fixed 31 May / 30 June with each month's previous month-end and month-end. - D3. Spot the error3 min
Someone suggests this simpler version of the numerator. What is wrong with it?
SELECT COUNT(DISTINCT customer_id) AS churned FROM subscriptions WHERE cancelled_on BETWEEN '2025-06-01' AND '2025-06-30';
- ○It still counts customers who cancelled one subscription and started another, so upgrades look like churn
- ○COUNT(DISTINCT) counts a customer twice if they had two subscriptions
- ○BETWEEN excludes 30 June
- ○cancelled_on must be cast to a timestamp before comparing
How marks become a result: the method.