SQL Quest

Lessons, hints, explained solutions, the in-browser PostgreSQL editor and practice answer checks in your browser are available. Graded assessments, recorded progress from answer checks and new certificates aren't available yet.

SQL Quest · part of Formula Quest

Learn SQL by running real queries.

Every lesson runs genuine PostgreSQL in your browser, against realistic databases for a retailer, a bank, a SaaS company, a hotel group and more. You write the SQL, see the actual result, and get feedback on what your query did.

lessons
151lessons
exercises
721exercises
business databases
11business databases
Lesson 5 · Your first queryPostgreSQL 18
SELECT customer_name, city
FROM customers
WHERE city = 'Riyadh';

Open lesson 5 to run this query on PostgreSQL in your browser and see its result.

A real database, in your browser

PostgreSQL runs on your device through WebAssembly. Every result you see comes from your query; nothing is pre-recorded. Break things freely and reset the data in a click.

Practice checks, hints and solutions

Check your practice answers in your browser: your query's result is compared with the expected result on the lesson's data, with feedback on missing rows, wrong columns, wrong values or order. Every exercise also has three levels of hints and an explained model solution.

From first query to capstone

12 tracks and 10 capstone projects on realistic business data. Graded assessments and certificates aren't available yet.

Curriculum

Twelve tracks, beginner to advanced

Full curriculum
  1. Track 01SQL FoundationsWhat databases are, how tables connect, and how to ask your first questions in SQL.10 lessons · 41 exercises · free
  2. Track 02Retrieving and Filtering DataAsk precise questions: calculate, filter, sort and page through exactly the rows you need.14 lessons · 56 exercises · free
  3. Track 03Aggregation and Business ReportingTurn thousands of rows into the counts, totals, rates and KPIs that businesses run on.13 lessons · 57 exercises
  4. Track 04Joining TablesCombine tables with confidence: match rows on keys, keep or find what is missing, and never double count.15 lessons · 60 exercises
  5. Track 05Subqueries and Advanced FilteringBreak hard questions into steps: queries that feed queries, EXISTS, CTE pipelines, recursion and set operations.12 lessons · 47 exercises
  6. Track 06Intermediate and Advanced AnalyticsWindow functions, rankings, running totals, period comparisons, time series, cohorts and retention.14 lessons · 56 exercises
  7. Track 07Data Cleaning and TransformationTurn messy operational data into trustworthy, analysis-ready tables.13 lessons · 52 exercises
  8. Track 08Database Creation and ManagementDesign tables that protect their data, change rows safely, and evolve a schema without breaking what depends on it.15 lessons · 60 exercises
  9. Track 09Performance and Query OptimizationRead query plans, build the right indexes and rewrite slow queries on a large event store.11 lessons · 39 exercises
  10. Track 10SQL for Business and FinanceRevenue, margin, the general ledger, budgets, reconciliation, banking and workforce analytics, written the way finance teams define them.13 lessons · 53 exercises
  11. Track 11SQL for Data Analytics and Business IntelligenceDesign trustworthy metrics on a star schema: KPIs, funnels, churn, lifetime value and datasets ready for dashboards.11 lessons · 46 exercises
  12. Track 12SQL Interview and Career PreparationPractise the questions interviewers actually ask, on schemas you have never seen, and learn to explain every line.10 lessons · 58 exercises

Free to start. Included with a Formula Quest membership.

Without an account you can take all of SQL Foundations and Retrieving and Filtering Data (34 free lessons in total), the first lesson of every track, the placement diagnostic, the playground, the dataset library and the SQL reference. Everything else is included with a Formula Quest membership that covers SQL: Single Quest with SQL selected, Quest Trio including SQL, or Quest Unlimited, or through your organization.