SQL practice · Studio operations · August 2026
Running Point pipeline analysis
From “how many inquiries?” to “what actually needs our attention?”
A small SQL practice project built on the workflow behind Courtside: incoming leads, client work, calls, tasks, and invoices. Six everyday business questions — and how to answer them without counting the wrong thing.
- Focus
- Joins, counts & data checks
- Tools
- PostgreSQL-compatible SQL · Run at sqliteonline.com
- Dataset
- 18 leads · 5 tables
- Scope
- Learning exercise · fixed sample snapshot
01 / The question
Make the workflow measurable
Designing Courtside raised questions a screen alone can't answer: which inquiries turn into client work, how long people wait for a first conversation, and what falls behind after kickoff. I used that familiar workflow as the basis for a small SQL practice project.
The goal isn't a fancy analytics setup. It's practicing the basics: define the question, find the right tables, pick a clear counting rule, and explain the answer — including what it doesn't tell you.
What is included: a small database, a sample dataset, six readable queries, and the results they produce. No customer information, live connections, automated decisions, or claimed business improvement.
02 / The data model
Five tables, one connected workflow
The lead ID links inquiries to calls and client records. The client record ID links those records to tasks and invoices. Anywhere one thing connects to many others is where counting mistakes start.
leads
18 rows
One row = one inquiry
id · source · owner · status · created_at
Parent of calls & client records
calls
14 rows
One row = one scheduled call
lead_id → leads.id · scheduled_for · outcome
Many calls can belong to one lead
clients
5 rows
One row = one service agreement
lead_id → leads.id · service_line · started_at
One lead can have multiple services
tasks
12 rows
One row = one work item
client_id → clients.id · assignee · status · due_date
Many tasks per service agreement
payments
8 rows
One row = one invoice
client_id → clients.id · amount_cents · invoiced_at · paid_at
Many invoices per service agreement
A simplification worth naming: the “clients” table is really a list of service agreements, not unique businesses — Vela appears twice. A fuller system would separate businesses, agreements, and invoices. This exercise keeps the model small and points out that limit.
03 / The queries
The question, the SQL, the answer
All results below were run at sqliteonline.com (free, nothing to install) on the sample data, using August 14, 2026 as the snapshot date. Load the schema and seed files there and the queries run as written.
LEFT JOIN · conditional counts
Which sources turn inquiries into client work?
How many inquiries from each source turned into client work, compared with how many came in?
select
l.source,
count(distinct l.id) as lead_records,
count(distinct case when c.id is not null then l.id end)
as converted_leads,
round(100.0 * count(distinct case when c.id is not null then l.id end)
/ nullif(count(distinct l.id), 0), 1) as conversion_pct
from leads l
left join clients c on c.lead_id = l.id
group by l.source
order by conversion_pct desc, lead_records desc, l.source;How it works
- Start with every lead, even the ones that never became clients. The LEFT JOIN keeps those in the count.
- Count each lead once, not each service record: one lead can turn into two services.
- Divide converted leads by total leads for each source. NULLIF just prevents an error if a source ever has zero leads.
The easy-to-miss detail
What you count matters. Vela has two service records but is one client — counting service records would wrongly show Instagram at 66.7% instead of 33.3%.
Verified sample output
Fictional data · not business performance| source | lead records | converted leads | conversion pct |
|---|---|---|---|
| referral | 4 | 2 | 50 |
| 3 | 1 | 33.3 | |
| 3 | 1 | 33.3 | |
| wix_form | 5 | 0 | 0 |
| 3 | 0 | 0 |
Referral converted 2 of its 4 leads (50%). This is a small fictional sample — not proof that referrals perform best for Running Point.
What this does not tell us: This counts submissions, so the same business submitting twice still shows up twice. The next query deals with that. Also, having a client record doesn't guarantee they ever paid.
04 / Checking the answer
Small checks before big claims
All six queries were run against the fixed sample. Along the way I caught and fixed one mistake: the conversion query first counted service records instead of converted leads. These checks are practice exercises, not tests on a real system.
- Check the counting unit
Vela's two services must still count as one converted lead.
- Check what's left out
Harbor's no-show and reschedule must not count as its first completed call.
- Check the deadline rule
Finished tasks, tasks due later, and tasks with no due date must not show up as overdue.
- Check the totals
The invoice groups must add up to $16,200 billed: $10,900 paid plus $5,300 unpaid.
05 / Relevance & next steps
A foundation to build on
My Medicare work taught me habits that carry over to reporting: be specific about rules, notice exceptions, and explain things clearly. This project applies those habits to data — deciding what one result means, handling missing records, and documenting what the numbers say.
The queries practice the skills reporting work depends on: joins, CTEs, window functions, date filters, conditional aggregation, and checking totals. My SQL experience is foundational, and this project is where I keep building it. I haven't yet worked in regulatory filing or owning production data — that's the growth I'm looking for in a reporting role.
Next: rerun and change each query on my own, test more edge cases, improve the business model, add validation rules, and work with a larger public dataset. Real compliance reporting would also require industry-specific rules, reconciling sources, privacy controls, and review steps.