RAJ
Free

SQL Case Study Practice

Practice SQL with realistic business analytics problems.

The situation

You work at a subscription product. Finance flagged that March revenue came in under plan, and nobody can say why. You have the customers, their subscriptions and the monthly payments. Work out what actually happened before the Monday review.

Sample data, invented for practice — small enough that you can check any answer by eye.

0 of 4 solved

Step 1

Start with the shape of the problem. What was total revenue in each month we have payments for?

Return columns: month, revenue

Why case studies, not drills

Most SQL practice gives you one table and asks for one clause. Real analyst interviews do not work like that: you get a schema, a vague business question, and the expectation that you will decide what to query. Each case here is a sequence — the later steps only make sense once the earlier ones have told you something, which is exactly the part that is hard to practise alone.

How your answer is graded

Your query runs against a real SQLite database in your browser, and the rows it returns are compared with the reference answer's. Row order is ignored unless the question asked you to sort, and your column names are not checked — aliasing something n instead of order_count teaches nothing about SQL. There is usually more than one correct query, and any of them will pass.

The data is invented, the patterns are not

The 2 scenarios use small hand-built sample data, so you can verify any answer by counting rows yourself. The situations — revenue dipping for a reason nobody can name, a funnel that looks fine in aggregate and is broken on one device — are the ones that actually come up.

Want shorter practice?

There is a daily SQL problem too — single-question drills with a streak, for when you have five minutes rather than half an hour.

Practising for an interview?

Real analyst roles, scraped daily from company career pages. No ghost jobs.

Browse analyst jobs
Raj