Free Online SQL Playground
Write SQL and see the results as tables. Runs SQLite in your browser, so you can create tables, insert rows and query them, with no database to set up.
Auto-run is on, so the results update as you type. This is SQLite. Each run starts with an empty database, so create your tables in the editor. Every statement that returns rows shows a table.
Preview
How to use
Write SQL in the editor. Start with CREATE TABLE and INSERT statements, because each run starts with an empty database.
Add SELECT statements to query your data. Each one shows its own table of results.
Watch the results update as you type, or turn off Auto-run and press Run.
Fix any error shown under the results. Statements before the error still show their results.
Copy the code, download a zip of your files or clear the editor with the icons above it.
Open the full screen editor for more room, and use the A buttons to resize the text.
Press Format to tidy the tab you are editing, or untick Wrap long lines to scroll sideways instead.
Why use this tool
SQLite
A real SQLite database, so tables, joins, grouping, window functions, recursive queries and JSON functions all work.
A table for every query
Each statement that returns rows gets its own result table, with NULLs and numbers shown clearly.
Fresh database every run
Nothing is carried over between runs, so the results always match the SQL in the editor.
Protected from runaway queries
A query that never ends is stopped after a few seconds, and a very large result shows its first rows.
One-click formatting
Tidy the indentation and spacing of the tab you are editing with one click or Shift + Alt + F.
Comfortable editor
Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.
About this tool
Write SQL and see the results straight away, with no database to install. This online SQL playground runs SQLite in your browser, so you can create tables, insert rows, join, group and sort them, and try queries safely. Each statement that returns rows gets its own result table, and statements that change data report how many rows they changed. Use it to learn SQL, check a query or sketch a schema before moving to a real database.
Frequently asked questions
SQLite. It is the same SQL used in phones, browsers and many apps, so most standard SQL works. Some features of MySQL or PostgreSQL, such as stored procedures, are not in SQLite.
No. Every run starts with an empty database, so put your CREATE TABLE and INSERT statements at the top of the editor. Your SQL itself is kept in this browser so it is there when you come back.
A query that runs for more than a few seconds is stopped, so a mistake such as a recursive query with no end cannot freeze the page. Add a LIMIT or a stopping condition and run it again.
The first 200 rows of each result are shown, with the total row count below the table. Use LIMIT or WHERE to look at a smaller set.
Yes, the first time. The SQLite engine is loaded from a public CDN when you open the page.
Yes. Press Format, or Shift + Alt + F while you are typing, to tidy the tab you are editing. If the code has a syntax error it is left unchanged and the problem is shown under the editor.
Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.