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
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
- Track 01SQL FoundationsWhat databases are, how tables connect, and how to ask your first questions in SQL.10 lessons · 41 exercises · free
- Track 02Retrieving and Filtering DataAsk precise questions: calculate, filter, sort and page through exactly the rows you need.14 lessons · 56 exercises · free
- Track 03Aggregation and Business ReportingTurn thousands of rows into the counts, totals, rates and KPIs that businesses run on.13 lessons · 57 exercises
- Track 04Joining TablesCombine tables with confidence: match rows on keys, keep or find what is missing, and never double count.15 lessons · 60 exercises
- Track 05Subqueries and Advanced FilteringBreak hard questions into steps: queries that feed queries, EXISTS, CTE pipelines, recursion and set operations.12 lessons · 47 exercises
- Track 06Intermediate and Advanced AnalyticsWindow functions, rankings, running totals, period comparisons, time series, cohorts and retention.14 lessons · 56 exercises
- Track 07Data Cleaning and TransformationTurn messy operational data into trustworthy, analysis-ready tables.13 lessons · 52 exercises
- 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
- Track 09Performance and Query OptimizationRead query plans, build the right indexes and rewrite slow queries on a large event store.11 lessons · 39 exercises
- 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
- 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
- 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
Datasets
Practise on businesses that behave like real ones
819,053 rows of fictional, synthetic data across 11 databases, built to expose the problems real data has: missing values, duplicate customers, split payments, returns, cancelled bookings, reversed transactions, dormant accounts, unbalanced draft journals.
Explore the dataset library- Wadi Market online store8 tables · 35,996 rows
- Rawabi Bank7 tables · 28,979 rows
- Masar Holding HR10 tables · 5,684 rows
- Mizan Cloud SaaS7 tables · 67,088 rows
- Shifa Clinics operations10 tables · 47,764 rows
- Sahra Logistics warehousing and transport12 tables · 92,456 rows
- Nakheel Hotels bookings7 tables · 35,882 rows
- Tahlia Trading ledger11 tables · 19,173 rows
- Wadi Market analytics mart7 tables · 65,785 rows
- Sooq Analytics event store4 tables · 420,200 rows
Capstone projects
Prove it on a full business problem
- E-commerce revenue and customer performance10 tasks
- Inventory and fulfilment performance review10 tasks
- Bank reconciliation for the year-end close9 tasks
- Workforce and pay analytics9 tasks
- SaaS MRR, churn and retention analysis8 tasks
- Customer segmentation and lifetime value10 tasks
- Business-intelligence reporting dataset10 tasks
- Advanced SQL performance and analysis10 tasks
- Hotel revenue management10 tasks
- Clinic operations analysis10 tasks
Career pathways
Choose the route that matches your job
- SQL for Data AnalystsAnswer business questions from raw tables, accurately and quickly.
- SQL for Business AnalystsTurn operational data into clear answers about processes and performance.
- SQL for Finance ProfessionalsWork directly with ledgers, transactions and budgets instead of exports.
- SQL for Business IntelligenceBuild the reporting layer dashboards depend on.
- SQL for DevelopersModel data correctly, change it safely and keep queries fast.
- Data Engineering FoundationsThe SQL a data engineer uses every day, from modelling to validation.
- SQL Interview PreparationPractise the problems interviewers ask, under time pressure.
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.