SpeedQL — Timed SQL Exercises

Learn SQL. Practice SQL. Level Up.

Timed game · 1 min · +30 s per correct answer

SpeedQL: free timed SQL exercises in your browser

SpeedQL turns SQL exercises into a game: you get real tables, a short task and one minute on the clock to write the query that answers it. It is free, there is no account to create, and a SQLite engine runs every query right in your browser, so you know instantly whether you got it right. Beginners start with SELECT and WHERE; experienced developers push their streak into window functions and recursive CTEs. Either way, you practice SQL by writing real queries, not by ticking multiple-choice answers.

  • 376 hand-written questions
  • 100 question templates with variables
  • 16 SQL topics
  • 12 data themes
  • 3 game modes
  • 0 sign-up

New to learning with games? Our comparison of the best SQL games shows where SpeedQL fits next to the classics.

How the timed SQL game works

A game takes seconds to start and lasts as long as you keep answering. Here is how it plays out:

  1. Press “Start”. After a 3-2-1 countdown, the clock starts at 1:00.
  2. Read the task and the sample tables, write your query in the editor, then run it with the Run button or Ctrl + Enter.
  3. If your result matches the expected one, your score goes up by 1 and you gain 30 seconds. Your query is also run on a second, hidden dataset, so a hard-coded answer does not pass.
  4. Every 5 correct answers, you move up a level and the questions get harder, from simple filters to joins, subqueries, CTEs and window functions.
  5. From level 5, a wrong answer costs 5 seconds. “Skip” jumps to another question for 10 seconds and no point, and it is refused when less than 10 seconds are left.
  6. When the clock hits zero, the game is over. You see your 5 best games, an estimate of where your score stands, and the expected answer to the last question, so every game teaches you something.

Your score is simply the number of correct answers: beat your record, then beat it again.

Three ways to practice SQL

Timed game

The main mode: one minute to start, 30 more seconds per correct answer, a new level every 5 correct answers. It builds speed and reflexes. Start a timed SQL game.

Custom SQL exercises

Tick the topics you want to work on, from JOIN to window functions, and practice with no timer. A two-step hint gives you the topic to use, then the shape of the query, and you can show the expected answer when you are stuck. Choose your SQL topics.

Daily SQL exercise

One numbered question a day, the same for everyone, from level 2 to level 8 over a 7-day cycle. Solve it to keep your day streak alive. Take today’s SQL exercise.

16 SQL topics to practice

Every question is tagged with the SQL topics it uses, and each link below opens the custom exercises with that topic already ticked. The questions draw on 12 realistic data themes: company (staff, sales, invoices), films, library, football, school, flights and airports, music streaming, weather, hotels, online shop, project management and banking.

  • SELECT, aliases, DISTINCT: choose the columns to show, rename them and remove duplicate rows. It is the first line of every query.
  • WHERE: keep only the rows that match a condition, with =, <, BETWEEN, IN or LIKE. Most real questions start with a filter.
  • ORDER BY, LIMIT: sort the result and keep the first rows, the recipe behind every “top 3” or “most recent” question.
  • COUNT, SUM, AVG, MIN, MAX: turn many rows into one number. This is how you answer “how many” and “how much”.
  • GROUP BY: compute one summary per group, such as sales per region. It is the heart of every report.
  • JOIN: link tables through a shared column, including LEFT JOIN to keep rows without a match. Real data almost always lives in several tables.
  • HAVING: filter groups after GROUP BY, for example departments with more than three people.
  • Subqueries: use the result of one query inside another, to compare each row with an average or a list.
  • CASE: write if/then logic inside a query to label rows or sort them into buckets.
  • NULL, COALESCE: handle missing values correctly, with IS NULL instead of = NULL and default values through COALESCE.
  • UNION, INTERSECT, EXCEPT: combine the results of two queries, keep what they share or what sets them apart.
  • Text and dates: clean and format data with UPPER, SUBSTR and LIKE, and pull the year or month out of a date.
  • CTEs (WITH): break a long query into named steps that read from top to bottom.
  • EXISTS: test whether related rows exist, the safe way to find customers who never ordered.
  • Window functions (OVER): rank rows, compute running totals and compare a row with the previous one, without grouping.
  • Recursive CTEs: generate sequences and walk hierarchies such as an org chart.

Each topic has its own card in the SQL cheat sheet.

Two SQL exercises with solutions

Here are two real questions from the SpeedQL question bank, one easy and one medium.

Easy: filter a table

Task: Show the name and salary of the employees in the Finance department.

SELECT name, salary
FROM employees
WHERE department = 'Finance';

WHERE keeps only the Finance rows, and the SELECT list keeps just the two columns asked for. Text values go between single quotes.

Medium: join two tables

Task: Show the name of each customer with the amount of each of their orders.

SELECT customers.name, orders.amount
FROM customers
INNER JOIN orders ON customers.id = orders.customer_id;

The join matches each order to its customer through customers.id = orders.customer_id. A customer with three orders appears on three rows, and a customer with no order does not appear at all, because INNER JOIN keeps only matching rows.

Want more? Browse the 196 exercises with solutions, sorted by topic.

Who are these SQL exercises for?

  • Complete beginners: level 1 starts with SELECT and WHERE, and the custom mode lets you learn with no timer and with hints.
  • Students in computer science, data or business courses who need to practice for exams and projects.
  • Future data analysts preparing for a technical interview, where writing a correct query quickly makes the difference. Our SQL interview questions cover the classics.
  • Developers who work through an ORM all day and want to keep their raw SQL sharp in a few minutes a day.

Why practice SQL against the clock

A timer changes the way you practice. It pushes you to write the query straight away instead of rereading the course, and that is how syntax becomes automatic. Short sessions spread over several days, like the daily exercise, help you remember more than one long session. And in a technical interview or a meeting, you rarely have time to look everything up: writing a JOIN or a GROUP BY without hesitating is exactly the reflex the timed game trains.

Frequently asked questions about SpeedQL

What is SpeedQL?

SpeedQL is a free game to learn and practice SQL: you solve questions by writing real queries, against the clock or at your own pace. It has 376 hand-written questions and 100 question templates with variables, across 16 SQL topics.

Is SpeedQL really free?

Yes. Every mode, question and hint is free, with no paid version and no targeted ads.

Do I need to create an account?

No. There is no sign-up and no login: open the page and play.

Which SQL engine does SpeedQL use?

SQLite, compiled to JavaScript with sql.js, runs directly in your browser. Read queries (SELECT, with or without WITH) are accepted, and nothing is sent to a server.

Is my progress saved?

Yes, in your browser on this device: your best score, your best games, your day streak, your solved daily exercises and your display settings. Nothing is synced between devices, but the File menu lets you export your progress to a file and import it elsewhere.

Does SpeedQL work on mobile?

Yes, the layout adapts to phones and tablets. Typing SQL is more comfortable with a physical keyboard, and once the game has loaded it also works offline.

Are there other SQL games?

Yes: SQL Murder Mystery, SQL Island, SQL Noir and SQLZoo each have their own style. We compare them honestly in our guide to the best SQL games.

SpeedQL