- This is real SQLite, compiled to WebAssembly by the sql.js project, running in your browser tab.
- Open .sqlite / .db file reads a database from your computer into memory (up to 300 MB). It is not uploaded anywhere.
- Download database saves the current database, including your changes, as
playground.sqlite. - Without a file of your own, a sample shop or HR database is loaded so you can start querying straight away.
- This is an editor, not SQLite hosting: nothing is stored online, and closing the tab discards anything you have not downloaded.
How to open and edit a SQLite file online
- Press Open .sqlite / .db file and choose a database file (.sqlite, .sqlite3, .db or .db3). Files over 300 MB are refused; use a desktop tool for those.
- The editor fills with a query that lists the tables and views, and Sample data: tables and columns opens to show each table's columns.
- Run queries with Run or Ctrl+Enter (Cmd+Enter on a Mac). Result tables show up to 1,000 rows; Download CSV saves the last result.
- When you have made changes, press Download database to save a copy as
playground.sqlite. Your original file is not modified.
The other buttons work as on the main SQL editor: Reset data and the Sample data menu reload a sample database (replacing an opened file in the page, not on your disk), and Copy share link puts the query, not the data, in the URL after #q=.
A SQLite database is a single file, and SQLite documents the format as cross-platform, which is why a file from a phone app, a Python script or a desktop program opens here unchanged.
Sample data and useful SQLite queries
With no file opened, the shop database is loaded: customers(customer_id, name, email, country, signup_date), products(product_id, name, category, price), orders(order_id, customer_id, order_date, status, total) and order_items(order_id, product_id, quantity, unit_price). The Sample data menu switches to an HR database with departments(dept_id, name, location) and employees(emp_id, name, dept_id, manager_id, job_title, salary, hire_date).
These queries work on any SQLite database; the last two use the shop tables.
SELECT name, type FROM sqlite_schema WHERE type IN ('table', 'view') ORDER BY name;
PRAGMA table_info(orders);SELECT sqlite_version();SELECT p.category, SUM(oi.quantity * oi.unit_price) AS revenue
FROM order_items oi
JOIN products p ON p.product_id = oi.product_id
GROUP BY p.category
ORDER BY revenue DESC;ALTER TABLE customers ADD COLUMN vip INTEGER DEFAULT 0;
UPDATE customers SET vip = 1
WHERE customer_id IN (SELECT customer_id FROM orders GROUP BY customer_id HAVING SUM(total) > 100);
SELECT name, vip FROM customers ORDER BY customer_id;Limitations
- Memory, not disk. sql.js keeps the database in memory and does not write back to your file. Download the result if you want to keep it.
- Size. The whole file must fit in the browser tab's memory; the page refuses files over 300 MB.
- No hosting. This page does not host a SQLite database online for an application to connect to. For that you need a server or a hosted service.
- SQLite rules apply. SQLite supports only some forms of
ALTER TABLE(rename table, add, rename and drop column), and it uses dynamic typing, so declared column types are not enforced the way they are in other databases.
For a desktop editor, see our SQLite GUI tools roundup. If you are deciding between engines, compare SQLite vs PostgreSQL and SQLite vs MySQL.
Privacy: your database never leaves your computer
When you open a file, the browser reads it into the page's memory and SQLite runs on your device. The file, your queries and the results are not sent to CodeWithSQL or to anyone else. Downloads are created in the browser as well. Closing or reloading the tab discards everything.
Practise on the sample data with the SQL exercises, or learn the basics step by step in the SQL beginner course.
Frequently asked questions
Is my SQLite file uploaded?
No. It is read into memory by your browser and queried there. Nothing is sent to our server.
How do I save my changes?
Press Download database. It exports the current database as playground.sqlite, which you can rename. Your original file is left unchanged.
Can I host a SQLite database online here?
No. This page is an editor that runs in your browser, so nothing is stored online. SQLite is an embedded database: an application normally opens the file directly on the machine where it runs.
Which files can I open?
SQLite database files, usually ending in .sqlite, .sqlite3, .db or .db3, up to 300 MB. A file in another format will fail to open with an error message.
Can I export a query result?
Yes. After a query returns rows, Download CSV saves the last result table as a CSV file.
Sources
- sql.js on GitHub
- sql.js documentation
- SQLite: Single-file cross-platform database
- SQLite: The schema table
- SQLite: PRAGMA statements
- SQLite: SQL features that SQLite does not implement
- SQLite: Datatypes in SQLite
- SQLite: About SQLite
Checked 8 October 2026.
How we research tool pages: our editorial method. The engines are open-source projects credited on each page.