← back home

learn sql

SQL tutorials

Hands-on lessons with a real Postgres database running right in your browser. Edit the queries, run them, and check your answers. Nothing to install, and you can't break anything: reload the page and the data starts fresh.

01 · Beginner

SELECT basics

Pull rows and columns out of a table, filter them with WHERE, sort with ORDER BY, and cap the results with LIMIT.

start →
02 · Beginner

Joining tables

Combine rows from related tables with INNER JOIN and LEFT JOIN, and use a LEFT JOIN to find rows with no match.

start →
03 · Intermediate

Totals with GROUP BY

Summarize data with COUNT, SUM, and AVG, group rows with GROUP BY, and filter groups with HAVING.

start →
free play

SQL playground

An empty editor and the sample databases. Write any query you like.

open →