Choose your next query.
136 exercises across 20 courses and interview tracks. Start with the fundamentals or practise for a role. See what's new (last update 30 Oct 2026).
Build the skill, one business question at a time.
Start at the beginning or jump to a topic you use at work. Every course runs on realistic sample data.
SQL basics: ask your first questions
Pull exactly the rows and columns you need from a business table: filter, sort, pick the top N, spot missing data and search text without touching a spreadsheet.
Totals, averages and groups
Turn raw rows into the numbers a manager asks for: counts, revenue, average order value, monthly trends and rates per group.
Join tables like an analyst
Combine customers, orders, products and people into one answer, find what is missing with LEFT JOIN, and keep your totals honest when tables multiply rows.
Clean messy data before you trust it
Fix messy emails, fill in missing values, catch duplicate customers, bucket values into bands and measure time between dates, so the numbers you report hold up.
Existence, sets and safe NULLs
Answer yes-or-no questions across tables with EXISTS, find missing relationships, combine lists with UNION, and keep missing values from corrupting reports.
Business metrics with SQL
Calculate paid invoice revenue, active paying customers, churn, unpaid invoices and support times from raw tables, with definitions you can defend.
CTEs and window functions for analysis
Break a hard question into readable steps with CTEs and use window functions for running totals, month-over-month changes, rankings, shares of total and cohorts.
Decision-ready business reports
Move beyond a correct query: define recurring revenue, measure activation, find unpaid balances, and reconcile billing mistakes before presenting a number.
Marketing analytics: spend, leads and CAC
Report spend, click-through, lead volume, conversion, CAC and ROAS by channel and campaign, and defend those numbers when organic leads, unpaid channels or fan-out joins would distort them.
Sales pipeline: win rates, cycles and quota
Build the numbers a sales leader runs the team on (open and weighted pipeline, win rates, sales cycles, quota attainment, loss reasons and stale deals) without counting open deals as losses or inflating revenue through joins.
Product analytics: usage, activation and retention
Turn raw usage events into active-account, adoption, activation and retention numbers you can defend in a product review, without counting events as customers or mixing churned accounts into current metrics.
Finance reporting: revenue, receivables and cash
Build the month-end numbers a finance team signs off on: billed versus collected, receivables aging, net revenue after refunds, discounts, budget use, customer concentration and quarterly growth.
People analytics: headcount, pay and org structure
Answer the questions HR and finance ask about tenure, hiring, pay fairness and reporting lines, with numbers that survive empty departments, duplicated joins and integer division.
Defend the number: SQL traps that mislead
Catch the plausible-looking queries that quietly produce wrong business numbers, and replace them with figures you can defend in a meeting.
Prepare for the questions your role will face.
Short SQL questions for finance, analysts and engineers. Explain the result and the tradeoffs, not just the syntax.
Finance analyst interview: defend the close
Practise billing, payment status, receivables and concentration questions with the definitions a finance interviewer will probe.
Data analyst interview: make the metric trustworthy
Work through common analyst screens: repeat buyers, missing relationships, rankings and defensible denominators.
Junior engineer interview: query the application data
Build confidence with filters, joins, NULLs and counts on a realistic product database.
Senior engineer interview: reason about data grain
Solve advanced SQL screens on deduplication, latest records, fan-out and safe aggregate design.
Product analyst interview: activation and retention
Turn usage events into account-level product metrics and explain the caveats behind each number.
Marketing analyst interview: acquisition math
Practise campaign spend, conversion and attribution questions without multiplying rows or losing organic traffic.