SQL Playground

Practice SQL with real sample databases. Queries run in your browser, so nothing is ever uploaded.

100% Browser-Based • Local Processing

SQL Playground

Engine idle
History
    sqlite — query
    Results

    Running the query above… results appear here. The SQLite engine loads once, then everything runs on your device.

    Schema

    Are you sure?

    Schema diagram

    Privacy Focused

    🔒 Local Processing. Your data never leaves your device.

    Instant Results

    🌐 Fully Client-Side. Runs instantly in your browser.

    No Signup

    ⚡ No accounts. No hassle. Just open and use.

    Browser Based

    🚀 Works right in your browser. No installs, no downloads.

    Practice SQL in Your Browser

    Direct answer: The SQL Playground runs a real SQLite engine inside your browser, so you can write and run SQL against three sample databases — or a .db file of your own — with nothing uploaded anywhere. Type a query and press Enter, and the rows come back in a grid you can copy as CSV or JSON. Errors are SQLite's own messages, shown exactly as the engine produced them.

    The SQL Playground running a SELECT against the Classroom database: the query in the terminal-style editor, a result grid below it with Copy CSV, Copy JSON and Download buttons, and the schema tree listing students, courses and enrollments
    A real SQLite engine in the page — the query, the rows it returned, and the schema it read them from

    This tool is ideal for developers, data analysts, and students who want to quickly test queries, analyze data sets, or practice SQL without the hassle of setting up a local database server. Simply write your SQL commands, hit run, and view the results instantly.

    It is a practice sandbox using SQLite. MySQL and PostgreSQL differ in some syntax, so check your target database's documentation before depending on a query in production.

    From First SELECT to Window Functions

    The Classroom database has three tables, students, courses and enrollments, which is enough to learn SELECT, WHERE, ORDER BY and your first JOIN without getting lost. Its columns cover text, integers, decimals, dates, booleans and NULLs.

    The Bookshop database drawn as an entity-relationship diagram in a dialog over the tool: its tables shown with their columns listed, and lines joining each foreign key to the table it points at
    Diagram reads the schema back out of the engine, so it always matches the database that is actually loaded

    The Bookshop database adds authors, books, customers, orders, order items and stock, so you can practise multi-table joins, GROUP BY, aggregates such as SUM and COUNT, HAVING, and subqueries against data that behaves like a real shop.

    The Sensors database holds a time series of readings from six devices, with temperature, humidity, pressure, battery level and signal strength, perfect for window functions such as LAG and ROW_NUMBER.

    How to Use the SQL Playground

    Writing and Executing Queries

    Type your SQL in the Query Editor. In Terminal Mode, press Enter to run the statement (Shift+Enter for a new line); in Script Mode, write several statements separated by semicolons and press Ctrl+Enter, or click the "Run" button, to execute them.

    Script Mode with several statements separated by semicolons in the editor and a per-statement log in the output panel below, each line naming the statement and how many rows it affected
    Script Mode runs the whole editor and logs each statement separately — Terminal Mode runs one at a time
    The SQL Playground on a 390-pixel phone: the toolbar wrapped over three rows, a Query, Schema and Results tab strip below it, and the Results tab showing the returned rows one full-width panel at a time
    On a phone the three panels become a tab strip — one at a time, full width

    Terminal Mode always runs the full statement, and Script Mode always runs the full script — there's no way to select and run just part of the editor's contents. To run only one statement out of several, delete or comment out the others, or switch to Terminal Mode for that one query.

    Managing Databases

    You start with a default sample database. To work with your own data, use the "Open .db file" button to load an existing SQLite (.sqlite, .db) file — up to 50MB. Your uploaded databases are securely saved in your browser's IndexedDB so they persist across sessions.

    Viewing Schema and History

    The Schema panel automatically updates to show the tables, columns, and data types in your current database. The History panel keeps a log of all successfully executed queries, making it easy to rerun previous commands.

    Still have questions?

    If you can't find the answer you're looking for, feel free to contact our support team.

    Contact Us

    Frequently Asked Questions

    What is the SQL Playground, and how do I run a query?

    It's a real SQLite database running entirely in your browser. Pick a sample database (or upload your own), write a query in the editor, and run it — press Enter in Terminal Mode, or Ctrl+Enter in Script Mode for multiple statements. Results appear in a grid below, and any error is SQLite's own message, shown exactly as the engine produced it.

    Is this a real SQLite database, or a simulation?

    Real. The engine is SQLite compiled to WebAssembly, self-hosted (not loaded from a third-party CDN), and run inside a Web Worker so it doesn't block the page. Query results, error messages, and behavior all come from actual SQLite — not a simplified parser mimicking SQL syntax.

    What sample databases are available, and what can I practice with each?

    Three. Classroom (students, courses, enrollments) is sized for first SELECTs, WHERE, and JOINs. Bookshop (authors, books, customers, orders, order items, stock) supports multi-table joins, GROUP BY, aggregates, and subqueries. Sensors (time-series device readings) is built for window functions like LAG and ROW_NUMBER.

    Can I upload my own SQLite database file?

    Yes — click Open .db file and select a .db, .sqlite, or .sqlite3 file, up to 50MB. It's read locally in your browser and never uploaded to a server. An oversized file is rejected immediately with a plain message rather than failing partway through.

    Does my uploaded database persist, or does it reset when I reload the page?

    It persists. Uploaded databases are mirrored into your browser's IndexedDB, so they're still there the next time you open the page — a genuinely uncommon feature among free browser SQL tools, most of which reset everything on reload. Reset all clears it deliberately, including your own uploads, so use that button with that in mind.

    Is SQLite the same as MySQL or PostgreSQL?

    No. SQLite is a real, widely-used database engine, but its syntax and behavior differ from MySQL and PostgreSQL in meaningful ways — type affinity instead of strict typing, different AUTOINCREMENT semantics, different date/time functions and upsert syntax. A query that works here is a good sign for production, not a guarantee — check your target engine's documentation before shipping it unchanged.

    What happens if my query runs too long or gets stuck?

    It's terminated automatically after a 5-second timeout, and the database engine is rebuilt from its last known state — the database itself survives, but whatever that specific statement was doing does not complete. The Stop button does the same thing manually, useful for a query you realize is wrong before it times out on its own.

    Can I run multiple SQL statements at once?

    Yes — switch to Script Mode, write several statements separated by semicolons, and press Ctrl+Enter (or click Run) to execute the whole script. Terminal Mode, by contrast, always runs exactly one statement at a time; there's no way to select and run only part of a longer query in either mode.

    Can I export my query results?

    Yes — three ways: Copy CSV and Copy JSON copy every row to your clipboard in that format, and Download saves the results as a .csv file. All three act on the Terminal Mode result grid.

    Does this run in my browser, and does it work offline?

    Yes. The SQLite engine, your queries, and any uploaded database all run and stay in your browser — nothing is transmitted to a server. Once the page and engine have loaded, it keeps working with no internet connection, and it's free with no account or signup required.

    Can I see the database schema and an ER diagram?

    Yes — the Schema tab shows the current database's tables, columns, and types, generated live from the engine's own introspection rather than a static description. Click Diagram for a visual ER diagram, rendered locally as inline SVG, with a Download SVG option to save it.

    Is it free, and are there limits?

    Yes, completely free — no payment, no signup, no account. The practical limits are the ones described above: a 5-second query timeout and a 50MB cap on uploaded database files. Beyond that, there's no cap on how many queries you run or how long you use the tool.

    Still have questions?

    If you can't find the answer you're looking for, feel free to contact our support team.

    Contact Us