Start L1

Analyst Arena › SQL test for data analysts

SQL test for data analysts

A timed SQL test where you write and run real queries, not pick from multiple choice. Five questions, 15 minutes, graded on the server. Pass it with the other three tests at your level and you get a certificate anyone can verify.

Take the L1 SQL testSign in with Google · works in your browser
5questions per level
15 minat L1–L3 (20 at L4, 25 at L5)
70%to pass
4SQL dialects to choose from

How the SQL test works

What the SQL test covers at each level

Sit L1, L2 or L3 directly, in any order. L4 opens once you've crossed L3, and L5 once you've crossed L4.

LevelTopicsWhat it says about you
L1 FoundationFiltering, sorting and limits, counting, distinct values, datesYou can pull a correct list or count from one table.
L2 DevelopingJoins, joins with aggregation, grouping, HAVING, averages, rates, anti-joinsYou can combine tables and summarise them without double counting.
L3 ProficientWindow functions, running totals, shares of total, top N per group, date logicYou can answer the questions a product team asks every week.
L4 AdvancedCohorts, month-over-month change, comparing periods, top N with ties, avoiding fan-out, payment attemptsYou catch the joins and edge cases that quietly break a metric.
L5 ExpertMedians, rolling windows, cumulative share, gaps and islands, sessionising events, sequences, choosing the right denominatorYou can take on the hardest analysis questions a senior analyst gets.

Sample SQL questions, with answers

These use a simple customers / orders schema written for this page; they aren't questions from the test. Answers are in PostgreSQL.

customers (customer_id, name, city, signup_date)
orders    (order_id, customer_id, order_date, status, amount)   -- status: 'completed', 'cancelled', 'refunded'
L1 · Dates

How many completed orders were placed in March 2026?

Count only completed orders, and include every order on 31 March.

Show a good answer
SELECT COUNT(*) AS completed_orders
FROM orders
WHERE status = 'completed'
  AND order_date >= DATE '2026-03-01'
  AND order_date <  DATE '2026-04-01';

The half-open range (>= the first of the month, < the first of the next) is the safe habit. BETWEEN '2026-03-01' AND '2026-03-31' silently drops orders placed after midnight on the 31st when order_date is a timestamp.

L2 · Anti-joins

Which customers have never placed an order?

Return each customer's ID and name.

Show a good answer
SELECT c.customer_id, c.name
FROM customers c
WHERE NOT EXISTS (
  SELECT 1 FROM orders o WHERE o.customer_id = c.customer_id
);

LEFT JOIN … WHERE o.order_id IS NULL also works. Be careful with NOT IN (SELECT customer_id FROM orders): if any customer_id in orders is NULL, it returns no rows at all.

L3 · Top N per group

What are the top 2 cities by completed revenue in each signup month?

Group customers by the month they signed up, then rank cities within each month.

Show a good answer
WITH city_rev AS (
  SELECT date_trunc('month', c.signup_date) AS signup_month,
         c.city,
         SUM(o.amount) AS revenue
  FROM customers c
  JOIN orders o ON o.customer_id = c.customer_id
  WHERE o.status = 'completed'
  GROUP BY 1, 2
)
SELECT signup_month, city, revenue
FROM (
  SELECT *, ROW_NUMBER() OVER (PARTITION BY signup_month ORDER BY revenue DESC) AS rn
  FROM city_rev
) t
WHERE rn <= 2
ORDER BY signup_month, revenue DESC;

Aggregate first, then rank. If ties should both be kept, use DENSE_RANK() or RANK() instead of ROW_NUMBER(), and say which you chose.

L4 · Month over month

How did completed revenue change month over month?

Show each month's revenue, the previous month's, and the percentage change.

Show a good answer
WITH monthly AS (
  SELECT date_trunc('month', order_date) AS month, SUM(amount) AS revenue
  FROM orders
  WHERE status = 'completed'
  GROUP BY 1
)
SELECT month,
       revenue,
       LAG(revenue) OVER (ORDER BY month) AS prev_revenue,
       ROUND(100.0 * (revenue - LAG(revenue) OVER (ORDER BY month))
             / NULLIF(LAG(revenue) OVER (ORDER BY month), 0), 1) AS pct_change
FROM monthly
ORDER BY month;

Two things interviewers look for: 100.0 so integer division doesn't round the change to zero, and NULLIF so a month with zero revenue doesn't crash the query. Watch for months with no orders at all: they won't appear, and LAG will compare non-adjacent months.

L5 · Medians

What is the median completed order value for each city?

Averages are pulled up by a few large orders; the team wants the median.

Show a good answer
SELECT c.city,
       PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY o.amount) AS median_order_value
FROM orders o
JOIN customers c ON c.customer_id = o.customer_id
WHERE o.status = 'completed'
GROUP BY c.city
ORDER BY median_order_value DESC;

In dialects without PERCENTILE_CONT (SQLite, MySQL), number the rows with ROW_NUMBER() and COUNT(*) OVER per city, then average the middle one or two rows. Knowing that fallback is the L5 part.

How to prepare

  1. Take L1 cold. It tells you more than a week of reading, and you can sit it again after 3 days.
  2. Practise on realistic data. The free practice cases give you a product database and instant grading on every query.
  3. Train where you came up short. Results show the topics you missed. The course covers joins, window functions, Excel and AI prompting in 58 lessons, each with a worked answer.
  4. Rehearse out loud. Real interviews ask you to explain your query. A mock interview with an experienced analyst is the closest practice.

Questions people ask

Is the SQL test free?

The L1, L2 and L3 tests are free: sign in with Google and start. No card is needed. L4 and L5 come with the course or a level pass (₹299 in India, $9 elsewhere), and each also needs a 30-minute interview with our team.

Which SQL dialect does the test use?

You choose: SQLite, PostgreSQL, DuckDB or MySQL. Queries run in your browser, and grading checks your result, so any correct query passes.

How long is the SQL test?

Fifteen minutes for five questions at L1 to L3 (three you write and two multiple choice at L2; two and three at L3), 20 minutes at L4 and 25 minutes at L5. There’s no timer per question: you split the test’s time however you like.

What score do I need to pass?

70%. Cross a level by passing all four of its tests: SQL, Excel, AI prompting and dashboards. A test you don’t pass can be sat again after 3 days.

Can employers check my result?

Yes. Every level you cross comes with a certificate code. Anyone can paste it into the certificate check to see the level, the test scores and whether it is still current. Levels stay current for 12 weeks, or 6 months with Arena Pro.

How do you stop cheating?

Tests run in full screen, one question at a time with no going back, and numbers can differ between candidates. Tab switches, pastes and answer timing are recorded; unusual sittings are reviewed by a person before the level counts.

Find out where you stand

L1 is four 15-minute tests: SQL, Excel, AI prompting and dashboards. Sign in with Google and start straight away. You'll get a certificate code anyone can check.

Start L1No card needed.

Keep reading

Data analyst interview questionsSQL, metrics, Excel and case questions with model answers.Mock interviewsPractise with an experienced analyst and get a written scorecard.