Now in early access, free to use

Master SQL by writing real queries against live databases.

SqlFlow gives you your own PostgreSQL 17 database for every challenge, with graded feedback and no setup. Write the query, run it, and learn from the result.

Runs in your browser · Real PostgreSQL 17 under the hood

16graded challenges
Your owndatabase per challenge
PG 17real PostgreSQL
QUERYSANDBOXCHECK
Where learners get stuck

Knowing SQL syntax isn't the same as using SQL.

Most courses end with a multiple-choice quiz, but real databases don't come with answer options. SqlFlow gives you a live database to practise in, so you learn to work through a query yourself.

Reading doesn't stick

Watching examples feels productive, but you'll remember very little until you write the queries yourself. Practice is what turns a concept into a skill you can use.

Practice data is too simple

Three-row tables and single-table queries don't prepare you for NULLs, duplicate rows, or multi-table joins. Real work looks more like a messy schema with a dozen tables.

Error messages leave you stuck

Postgres errors are terse and often point at the wrong line. Without a hint, one missing alias or a misplaced GROUP BY can cost you half an hour.

You get a result, not a reason

Knowing an answer is wrong doesn't show you why your rows were off or how the correct query gets there. Clear, specific feedback is what closes that gap.

How it works

From prompt to passing query in four steps.

SqlFlow walks you through each challenge with a live editor, its sample tables, and graded feedback.

01

Read the challenge, inspect the sample tables

Every challenge shows the question, the columns the answer must return, and its sample tables with rows, so you know exactly what you're working with.

Challenge prompt

The platform has three roles: student, instructor, and admin. Write a query to find all users with the 'admin' role. Return only their id, email, and display_name.

Expected columns

idemaildisplay_name
02

Submit and see which checks passed

After each submission, every check is listed as passed or failed, with a weighted score. This is a sample run: the row count and columns match, but one row's values differ.

Overall67out of 100
  • Row count
    100
  • Column names
    100
  • Row values
    0

Findings

  • criticalRow 2 values do not match expected output
  • warningHidden checks show pass or fail only, with no reason
03

See which check failed and why

When a check fails, SqlFlow says which one: row count, column names, or the first row whose values differ. Hidden checks report pass or fail only, so the answer can't be reverse-engineered.

  • Expected 3 rows but got 4
  • Column mismatch: expected 'display_name' but got 'name'
  • Row 2 values do not match expected output
  • Expected exactly 1 row but got 2
04

Practise from easy to hard

Challenges are tagged Easy, Medium, or Hard. Today there are 16 challenges, mostly on one users table. More topics are on the roadmap.

Filter with WHERECOUNT rowsRead one table→ GROUP BY and duplicates
  1. 01Easy
    • Select all user info
    • Filter by role or flag
    • Count unverified users
    • Find users without an image
  2. 02Medium
    • Count users by role
    • Find duplicate emails
    • Find corporate email users
    • Find the highest ID
  3. 03Hard
    • Count verified users per role
    • More advanced topics on the roadmap
The grading engine

Deterministic grading. Every time.

Your script runs in your own database. Column names are lower-cased, rows are sorted by value, numeric strings are compared as numbers, and NULLs stay NULL. The result is then compared to the expected output. No flaky string matching.

5 gates

Query validation pipeline

Your script passes through five stages. Each stage reports its own result, so a failure always points to a specific step.

Pipeline

  1. 01Parse statements
  2. 02Run in your database
  3. 03Normalise result
  4. 04Compare to expected
  5. 05Score emit

On a failed check, explain why

  1. 01Compare row count
  2. 02Compare column names
  3. 03Compare row values
  4. 04Show the reason
01

Your own database

Every student gets a PostgreSQL database of their own, seeded with the challenge's tables. Other students' data is not reachable from it.

02

Real SQL, not a simulator

Run any statement your database allows, including CREATE, INSERT, UPDATE, DELETE, and transactions. Scripts run in order and stop at the first error.

03

Sample data on the page

Each challenge lists its tables with sample rows, so you can check column names and values before you write a query.

04

The platform's own data model

The graph below is the platform's data model: users, assignments, attempts, submissions, and their results.

Layer 01

Intelligence

Splits your script into statements with the PostgreSQL parser, then runs them one at a time and stops at the first error.

  • pgsql-parser
  • statement splitter
  • error stop
  • per-statement results
Layer 02

Architecture Engine

Runs your script in your own database as a limited role, with a time watchdog and a size check before each run.

  • pg-boss queue
  • per-student database
  • role limits
  • timeout watchdog
Layer 03

Executors

Lower-cases column names and sorts rows, then compares the result with the expected output and reports the first check that fails.

  • normalizer
  • comparator
  • failure reasons
  • score calculator
UI

An interactive architecture workbench

Nodes for every dependency, a floating action toolbar, and collapsible panels for the YAML source and the generated file tree.

The solution

A graded sandbox that explains every result.

SqlFlow runs your statements against your own PostgreSQL database, normalises both results, and tells you which check failed, so every wrong answer is a learning moment.

  1. 01Execute against an isolated database
  2. 02Compare the result row by row
  3. 03Explain exactly what changed
ExecutionLive sandbox
  1. 01
    QueryINPUT

    SELECT * FROM users;

  2. 02
    Isolated PostgresEXECUTE

    production · 1,284 rows

  3. 03
    Result comparisonDIFF

    1,284 expected · 1,286 actual (+2)

  4. 04
    Explanation

    The result differs because the updated schema includes two additional rows introduced by the migration.

Who it's for

Whether you're starting out or sharpening up.

CS students

Reinforce what your database course teaches by running the queries yourself against a real PostgreSQL database, not pasting them into a slideshow.

Backend developers

Practise DDL, DML, and transactions in a scratch database, without setting up a local Postgres or hunting for sample data.

Data analysts

Practise counting, filtering, and grouping on a realistic users dataset. More analytics challenges are on the roadmap.

Interview prep

Practise the query patterns that come up in interviews: filtering, counting, grouping, and duplicate detection.

Career switchers

Working toward a data or backend role? Start with filters and counts, then work up through grouping and duplicate detection.

Team onboarding

Let new engineers practise SQL on sample data today. Custom schemas for teams are on the roadmap.

Built to teach

Every design decision serves one goal: faster learning.

SqlFlow is built on the premise that you learn SQL by writing SQL, not by watching someone else write it. Every feature is optimised for the feedback loop.

01

Fast feedback

Hit Run and see your results as soon as the query finishes. The tight loop between writing and seeing is the core of skill-building.

02

Explain the failure, not just the answer

When you're wrong, we show which check failed and, for visible checks, the first row that differs. Understanding the gap is the lesson.

03

Realistic data

Challenges share a users table with NULLs, duplicate emails, and mixed roles. What you practise is the kind of data you'll see at work.

04

Difficulty that builds

Challenges are tagged Easy, Medium, or Hard. Start with filters and counts, then move on to grouping and duplicate detection.

05

No setup friction

Sign up and start your first challenge. No local Postgres, no Docker, no config files.

Adaptive grading

The engine decides what counts as correct, not a regex.

Column orderIgnored

The order of columns in your result doesn't matter. Column names are sorted before they are compared.

Row orderNormalised

Without an ORDER BY, Postgres can return rows in any order. Rows are sorted by value before comparing, so a correct answer isn't failed for its order.

Numeric stringsCoerced

"42" and 42 are the same answer. The normaliser coerces numeric strings so type-casting edge cases don't penalise you.

NULL handlingStrict

NULLs are semantically significant. A missing NULL or unexpected NULL counts as a row mismatch.