Tutorials

Five hands-on SQL workflows, from schema to finished queries

Five self-contained tutorials. Every query runs live in the browser via WebAssembly. Edit the SQL and re-run. No server required.

Tutorial 1
Build a Task Tracker

Design a project-management schema with tasks, labels, and assignments. Covers SERIAL, foreign keys, CHECK constraints, ON CONFLICT upserts, and RETURNING.

CRUD CONSTRAINTS UPSERT RETURNING
Tutorial 2
Reporting Dashboard

Build a sales pipeline and slice it with aggregation, window functions, ROLLUP/CUBE, and reusable views. Rank reps, compute running totals, and generate subtotal rows.

GROUP BY WINDOW ROLLUP VIEWS
Tutorial 3
Time-Series Analytics

Model sensor readings with timestamps and intervals. Use DATE_TRUNC, EXTRACT, AGE, TO_CHAR, recursive CTEs to fill date gaps, and window frames for moving averages.

DATE/TIME INTERVAL CTE WINDOW FRAMES
Tutorial 4
Multi-Table Joins

An e-commerce schema with users, orders, items, and products. Walk through INNER, LEFT, RIGHT, FULL, CROSS, and NATURAL joins, plus correlated subqueries and EXISTS.

JOIN SUBQUERY EXISTS DERIVED TABLE
Tutorial 5
Schema Evolution

Start with a v1 schema and evolve it: add columns, rename fields, change types with CAST/::, and wrap migrations in transactions with nested BEGIN/COMMIT.

ALTER TABLE CAST TRANSACTIONS MIGRATION