Ctrl+Enter to run · Database resets on each Run · First run loads sql.js (~1MB, cached after)
Try these examples
Click any example to load it, then hit Run.
How this works
sql.js is SQLite — the world's most-used database engine — compiled to WebAssembly. When you press Run for the first time, the browser downloads sql.js (~1MB) and caches it. Every subsequent run is instant.
Each Run creates a fresh in-memory database, executes your SQL statements one by one, and displays SELECT results as formatted tables. Non-SELECT statements (CREATE, INSERT, UPDATE, DELETE) show a ✓ confirmation. Errors show in red with the SQLite error message.
SQLite vs other databases: SQLite supports standard SQL — SELECT, INSERT, UPDATE, DELETE, JOIN, GROUP BY, HAVING, subqueries, CTEs, window functions, and transactions. A few things are different from PostgreSQL or MySQL: data types are flexible, there's no native BOOLEAN (use 0/1), and some advanced features (e.g. RIGHT JOIN) aren't supported.
What to try next
- SQL language reference — deep dives on JOINs, indexes, transactions, and query planning
- SQL snippets — 15 copy-ready patterns for common queries
- Python playground — combine Python logic with SQL data
- JavaScript playground — JS array methods as an alternative mental model