sqlstreak

SQLite playground: run SQLite online

SQLite compiled to WebAssembly, running right in your browser with sample databases loaded. Write a query, press Run, see the result. Below: how SQLite differs, and five queries that only work in SQLite.

SQLite 3.54.1, read from the engine itself when this page was built.

Each run starts from a fresh copy of the sample data. To try your own tables, put CREATE TABLE, INSERT and your SELECT in one run.

What works here

  • ✓CTEs, including WITH RECURSIVE
  • ✓Window functions, FILTER (WHERE …) and RIGHT and FULL OUTER JOIN
  • ✓Date functions: date, strftime, julianday
  • ✓JSON functions (json_object, json_extract)
  • ✓UPSERT (ON CONFLICT … DO UPDATE) and RETURNING
  • ✓CREATE TABLE, INSERT, UPDATE, DELETE, views and indexes

How SQLite is different

  • –Typing is flexible: a column's type is a hint, not a rule
  • –There is no DATE type: dates are ISO text, and date functions read the text
  • –Some loose old behaviour is still on (double-quoted text, bare columns in GROUP BY)
  • –Every run starts from a fresh copy of the data

Five queries only SQLite runs

Each one was run on both engines when this page was built: it works in SQLite and fails in PostgreSQL. More side by side in PostgreSQL vs SQLite.

SQLite questions

Is this a real SQLite?+

Yes. It's SQLite compiled to WebAssembly (sql.js), running in your browser tab. The version is printed above. Nothing is sent to a server.

Does SQLite support RIGHT JOIN and FULL OUTER JOIN?+

Yes, since SQLite 3.39.0 (2022), so both work here. Older SQLite builds, still found in some tools, only have LEFT JOIN; there you swap the tables or combine two LEFT JOINs with UNION.

Does SQLite have a DATE type?+

No. Dates are stored as text such as '2026-03-01' (or as numbers), and the date functions date(), strftime() and julianday() read that text. ISO text sorts and compares correctly, which is why it's the usual choice.

Why does SQLite accept a GROUP BY that PostgreSQL rejects?+

SQLite allows bare columns: columns in SELECT that are neither grouped nor aggregated. With a single MAX or MIN they come from that row; otherwise from an arbitrary row. PostgreSQL refuses rather than guess, so write portable SQL with a window function.

Is SQLite strict about types?+

Not by default: a column declared INTEGER happily stores text. Tables created WITH STRICT reject the wrong type, and they work here too.

SQL guides

Joins, window functions, CTEs and more, with runnable examples.

SQL errors explained

What common PostgreSQL and SQLite errors mean and how to fix them.

Learn SQL daily

Five-minute lessons with instant feedback and a streak. Free to start.