learn-sql-with-phoebe / Leader session 4 of 6
Learn SQL with Phoebe · Leader track · Session 4 of 6

The dashboard behind the dashboard

A dashboard tile looks like a fact. It is not - it is a saved SQL query that returned one number, wrapped in a nice font. This session teaches you to peel back the tile: see the query underneath, spot the definition choices baked into it, and know why the same word can show two different numbers on two tiles and both be correct.

🟡 Leader track C-level · managers · curious non-coders No install · nothing to write 45 min
0-3 · Recap 3-21 · Peel back a tile 21-39 · Cohorts, snapshots & rates 39-45 · Q&A
Part 0

Where we are

You can read a query and judge a claim. Now we point that skill at the artifact you see most: the dashboard. Every KPI tile - active subscribers, revenue, churn - is a one-line SQL query someone saved months ago and rarely revisits. Understanding that a tile is a query, not a truth, is what lets you ask why two "subscriber" counts disagree and which one belongs in the decision.

Live - discussed in session Self-study - read after ▶ See it run - a real query, live For decision-makers
★ What you walk out with today The habit of seeing the query under every tile, the difference between a cohort view and a snapshot, and the one rule that makes a rate trustworthy: its numerator and denominator must describe the same population.
Part 1 · what a tile really is

Peel back a tile 6 min live

A KPI tile is the friendly face on a saved SELECT. The big number, the little label, the trend arrow - all of it is the result of a query the BI tool runs on a schedule. Peel it back and the definition choices become visible: which table, which filter, which grain. That is where the real meaning lives.

Active subscribers 8 ▲ this month The query underneath SELECT COUNT(*) FROM subscriptions WHERE cancel_date IS NULL; peel it back The tile is a fact-shaped wrapper around a definition choice - here, "active means not cancelled".
🔍 Click to zoom - a KPI tile peeled back to the query that made it
LiveThe query behind an "active subscribers" tile3 min

This is the exact one-liner that a tile like the one above runs. Read it: "count the subscriptions where the cancel date is empty" - because an empty cancel date means the subscription is still live. Run it and you have reproduced the dashboard number yourself.

SELECT COUNT(*) AS active_subs
FROM subscriptions
WHERE cancel_date IS NULL;
The peel-back habit For any tile that drives a decision, ask to see its query - or just its definition in one sentence. A tile you cannot define is a tile you cannot trust.
Part 2 · same word, two numbers

Aggregation traps: cohort vs snapshot 6 min live

The most common dashboard confusion is one word carrying two definitions. "Subscribers" can mean everyone who ever subscribed, or only those active right now - and a dashboard can show both on different tiles, each true. The trap is a denominator game: the word stays the same while the population underneath quietly changes.

subscriptions - all 10 rows sub_idcancel_date 1NULL 22026-03-10 3NULL 4NULL 52026-04-02 6NULL 7NULL 8NULL 9NULL 10NULL SELECT COUNT(*) FROM subscriptions WHERE cancel_date IS NULL; SELECT COUNT(*) FROM subscriptions; 8 active_subs rows 2 and 5 drop out 10 all_subs cancelled ones count too Same table, same word on the slide. NULL means "never cancelled", so the WHERE line is the entire definition of "active".
🔍 Click to zoom - "subscribers" is 8 or 10 depending on one WHERE line
Live"Subscribers", version one: active only2 min

The active definition again - only live subscriptions count. Run it and hold the number in mind.

SELECT COUNT(*) AS active_subs
FROM subscriptions
WHERE cancel_date IS NULL;
Live"Subscribers", version two: all-time2 min

Same table, drop the filter. Now every subscription ever started counts, including the cancelled ones. Read it: "count all subscriptions." Run it - a larger number, and just as truthful. Same word "subscribers", two numbers, both correct.

SELECT COUNT(*) AS all_subs
FROM subscriptions;
Real world

The board that saw two "subscriber" numbers. Marketing reported all-time subscribers to show reach; finance reported active subscribers to show recurring revenue. Same word on two slides, two different figures, and twenty minutes lost to "whose number is wrong?" Neither was. The lesson: a count means nothing until the population is named. Ask "active now, or all-time?" before you compare.

Part 3 · numerator over denominator

Reading a rate: the two halves must match 6 min live

A rate is a fraction, and it is only honest when the top and the bottom describe the same population over the same window. Churn rate is the classic offender: churned customers divided by... which customers? All-time? Active at the start of the month? The denominator you choose can move a churn number by a wide margin without a single customer changing.

LiveA cohort view: new customers per signup month3 min

This groups customers into monthly cohorts by their signup month. Read it: "count new customers, per signup month, in date order." substr(signup_date,1,7) just keeps the year and month, like 2026-03. Run it - this is a cohort view, and it tells a different story than a single "total customers" snapshot tile would.

The snapshot tile Customers 15 one number, right now - no story of when they came The cohort view: the same 15 customers, per signup month 1 2025-11 1 2025-12 3 2026-01 3 2026-02 3 2026-03 2 2026-04 2 2026-05 substr(signup_date, 1, 7) keeps just "2026-03", so GROUP BY buckets people by joining month. Both views count the same 15 people; only the cohort view shows signups plateauing at 3 and easing to 2.
🔍 Click to zoom - the snapshot says 15, the cohort view says the pace changed
SELECT substr(signup_date, 1, 7) AS cohort,
       COUNT(*) AS new_customers
FROM customers
GROUP BY cohort
ORDER BY cohort;
Cohort versus snapshot A snapshot is "how many right now". A cohort is "how many joined in each period, tracked over time". A growth or churn story needs the cohort; a single tile usually shows the snapshot. Know which one you are looking at.
Self-studyThree churn-rate definitions, three numbers2 min read

"Churn was 5%" is not a fact until the denominator is named. Here are three common bottoms, each giving a different rate from the same churned customers:

DenominatorChurn rate meansWatch for
Active at month startshare of the live base that leftthe standard, but the base shifts monthly
All-time subscribersshare of everyone who ever joinedflatters the number - big, stable bottom
This month's cohortearly drop-off of new joinersa different question entirely

None is wrong; they answer different questions. The rule that keeps you safe: the numerator and denominator must be defined over the same population. If the churned customers on top are not drawn from the base on the bottom, the rate is meaningless.

Boardroom exercise

Reverse-engineer one of your own tiles ★ 12 min · discuss together

Take one KPI from a dashboard you actually use. As a group, write its likely one-line query definition, then name the trap to check. You are not writing production SQL - you are stating the definition precisely enough that an analyst could confirm or correct it.

Name the tile and guess the query: which table, which filter, which grain? Write it as one plain sentence.

Name the trap: is it a snapshot pretending to be a trend? A count whose population is ambiguous? A rate with a mismatched denominator?

Write the question for your analyst: one sentence that would confirm the definition. That question is the whole deliverable.

LiveModel it on the active-subscribers tile3 min

Use this as your worked example. The tile says "active subscribers"; the one-line definition is "subscriptions where cancel_date is empty"; the trap is "does 'active' mean active now or all-time?" Run it, then repeat the pattern on your own tile.

SELECT COUNT(*) AS active_subs
FROM subscriptions
WHERE cancel_date IS NULL;
LiveA second tile: completed-order volume3 min

Another worked example. Tile: "orders this period"; definition: "count of orders where status is completed"; trap: "are refunds and cancellations included?" Run it and see how the definition choice sets the number.

SELECT COUNT(*) AS completed_orders
FROM orders
WHERE status = 'completed';
Between sessions

Take this back to your desk ◐ 15 min

Source material

What this maps to

This session connects SQL reading to the BI layer leaders live in every day - dashboards and KPIs - and the definition traps that hide inside them. It covers:

BI / dashboard concepts - a tile is a saved queryPart 1 · peeling a KPI back to its SELECT
Cohort vs snapshot, denominator gamesParts 2-3 · same word, two numbers; rates that match populations
Mode analytics framing - metrics as saved SQLPart 1 self-study; full data-request treatment in session a5
Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · A dashboard tile is, underneath...

Every KPI tile is a saved SELECT the BI tool re-runs. The number is real, but so are the definition choices baked into the query - which is what you learn to peel back.

2 · "Active subscribers" can be two different numbers because...

Same word, two populations. "Active now" filters to live subscriptions; "all-time" counts everyone who ever joined. Both are true; ask which definition the tile used.

3 · A rate is trustworthy only when...

A rate is top over bottom. If the churned customers on top are not drawn from the base on the bottom, the rate is meaningless - no matter how precise it looks.

Leader session 4 cheat sheet · pin this

Every tile is a querya saved SELECT returning one number, refreshed on a schedule.
Peel it backask for the tile's definition in one sentence - table, filter, grain.
Same word, two numbers"active" vs "all-time" subscribers - both true, name the population.
Cohort vs snapshotsnapshot = right now; cohort = grouped by period, tracked over time.
A rate is top over bottomnumerator and denominator must cover the same population.
Churn depends on its denominatoractive base, all-time, or this month's cohort - three different rates.
The deliverableone sentence your analyst can confirm - that is a good data question.
Next sessiona5 · asking for the right cut - commissioning data precisely.