Browse by topic
Questions by topic
The question bank, grouped by the SQL concept each question drills.
Window functions
Ranking, running totals, and comparing a row to its neighbours without collapsing the result set. This is the topic that most often separates a mid-level candidate from a junior one, and PARTITION BY is where it goes wrong.
17 questionsSQL basics
SELECT, WHERE, ORDER BY and the logic that hangs off them. These are the questions that decide whether the rest of an interview happens, and the usual failure isn't syntax — it's a filter that silently drops NULLs.
14 questionsStatistics and A/B testing
Reading an experiment with SQL: lift, pooled rates, sample-ratio checks and significance from a critical-values table. Candidates who can write SQL often freeze here, which is exactly why it's worth practising.
12 questionsAggregation
GROUP BY, HAVING and conditional aggregates. The recurring skill is filtering at the right stage — WHERE before grouping, HAVING after — and knowing why COUNT(*) and COUNT(column) disagree.
10 questionsDates and times
Truncating, bucketing and differencing timestamps. Month-over-month and cohort-style questions live here, and the traps are boundary conditions: inclusive vs exclusive ranges, and days that fall exactly on the edge.
9 questionsJoins
Combining tables, and knowing which rows you're about to lose. Most join questions here have a LEFT-vs-INNER trap somewhere in them, because that's the mistake that returns a plausible-looking answer instead of an error.
9 questionsText and pattern matching
Parsing, splitting and matching strings that arrived messier than you'd like. Real analyst work, and the questions reward knowing where a LIKE wildcard is anchored and what TRIM actually removes.
8 questionsMath and numbers
Rounding, bucketing and arithmetic that has to be exactly right. The classic trap is integer division silently flooring a percentage to zero — cast before you divide.
7 questionsSubqueries and CTEs
Building a query in stages, with CTEs and correlated subqueries. These questions are less about syntax than about decomposition — most become straightforward once the intermediate result is named.
7 questionsIndexing
What an index actually buys you, read straight off a query plan — and what it costs on every write. The recurring trap is treating an index as free, or assuming one exists just because a column looks like it should have one.
3 questionsSchema design
Primary keys, foreign keys, and shaping tables so a fact is stored exactly once. Interviewers ask this alongside query-writing, not instead of it, and it's the half a query-language tutorial alone never covers.
3 questions