A hands-on SQL course for beginners

Learn SQL from scratch, step by step

Understand each concept, write queries and check your results across 52 lessons with an interactive SQL lab.

We may earn a commission if you purchase through these links. Details

Your first querySQL
SELECT name, city
FROM customers
WHERE city = 'London';
namecity
AmyLondon
MeganLondon
52lessons
9modules
52labs
∞attempts
How you will learn

One idea at a time, with practice straight away

Each lesson explains a concept, shows it with data and ends with a query you can run and correct.

1

Understand the idea

First you see which problem it solves and what changes in the data.

2

Look at an example

You read a query step by step and compare the result.

3

Write the query

You practise with a database inside your browser.

4

Get help

You can open hints, make corrections and try again with no penalty.

SQL Quest · 30 levels

Would you rather learn SQL by playing?

Choose Arcane Academy, Mission Cosmos or District 404 and complete 30 missions with real queries. Your progress carries over even if you switch worlds.

From your first query to a final mission

  • 30 levels in 6 stages.
  • 3 worlds with their own databases.
  • Real SQL running in your browser.
  • Progress shared across worlds and saved locally.
Course syllabus

What the free online SQL course includes

An SQL course from beginner to advanced: 52 lessons in 9 modules, each with exercises you run in your browser. Follow it in order from scratch or open only the topic you need.

01

Queries and filters

SELECT, WHERE, operators, NULL, sorting and removing duplicates, with small examples that show which rows get in and why.

02

Aggregation and relationships

COUNT, SUM, GROUP BY, HAVING and JOIN, explained with results you can check, so you avoid cardinality mistakes and misplaced filters.

03

Intermediate SQL

Subqueries, CTEs, set operations, CASE, text functions, dates, views and window functions, with compatibility notes.

04

Data and structure

INSERT, UPDATE, DELETE, transactions, CREATE TABLE, keys, constraints, ALTER TABLE and an introduction to performance and indexes.

The 9 modules: Orientation, Selecting data, Filtering data, Sorting and summarising, Relating tables, Advanced queries, Modifying data, Designing tables, Putting it together.

See the full SQL course syllabus. There is nothing to install and no sign-up. The course does not issue a certificate: it is designed for learning and practice.

How we look after the content

Our own examples, technical sources and practice in your browser

The lessons are written to teach a specific decision, not to repeat the documentation. The examples are checked against the expected behaviour, and when the syntax differs between PostgreSQL, MySQL, SQL Server or SQLite, we say so explicitly.

The lab runs on made-up data inside your browser and saves your progress locally. You do not need an account to read the lessons or to practise.

What you will find in each lesson

  • A specific learning goal.
  • SQL examples explained step by step.
  • Common mistakes and how to diagnose them.
  • A practice task or a comprehension check.
  • Sources and compatibility notes where they add context.

If you spot a mistake, you can report it through our contact channel and read our corrections policy.