SQL SELECT / WHERE / ORDER Playground

The register of residents at the village office: write SELECT, WHERE, ORDER BY and LIMIT yourself, and a real SQLite answers step by step. What does = NULL…

Why it matters

SQL is everywhere (backends, data, analytics). Knowing that the run order differs from the written order explains why an alias cannot go in WHERE (in MySQL and PostgreSQL), why LIMIT without ORDER BY gives arbitrary rows, and why = NULL never finds anything.

The key idea

SQL is declarative, and it runs in a different order than it is written

Common mistakes

Try it in this playground