SQL Playground
Write SQL and run it instantly on a sample database. Everything runs in your browser; nothing is sent to a server.
Ctrl + Enter (⌘ + Enter on Mac) runs the query. Several statements separated by semicolons run in order.
Loading SQLite…
What is in the sample database?
The playground starts with the same tables the SQL course uses, so you can run the lesson examples and change them to see what happens:
employees: names, departments, salaries, cities, managers and hire datescustomersandorders: for practising joinsproducts: categories, prices and stock levelsmonthly_salesandscores: for window functions and rankings
Every SQL practice set is in the Database menu too, so you can try your answers on exactly the tables each set describes.
How it works
The playground runs SQLite, compiled to WebAssembly with the open-source sql.js library, entirely inside your browser. You can create tables, insert, update and delete rows; changes last until you press Reset data or leave the page.
Most of what you learn here works the same in MySQL, PostgreSQL and SQL Server. A few features differ between databases, such as date functions, LIMIT versus TOP, and ANY/ALL, which SQLite does not support. The lessons point these out where they matter.