Create a SQLite Database Online
Press Run to turn this starter SQL into a SQLite database with a notes table and one row. Replace the table definitions and INSERT statements with your own SQLite script, run it, then use the .sqlite button to download the database. Keep Empty database selected when rebuilding a complete schema; switch to Current database when adding changes to a database you already created.
Press Run, or Ctrl+Enter in the editor. The first run downloads the 643.0 KB SQLite engine from this site and checks it against a pinned SHA-256 hash.
- Engine
- SQLite 3.49.1
- Time limit
- 2 s a run
- Limits
- 64 KB SQL, 10 MB file
- Result
- none yet
Ctrl+Enter (Cmd+Enter on a Mac) runs the script. It holds up to 65,536 bytes (64 KB) and is kept in this browser until you press Reset. The database is held in this tab only and is never saved, so download it with the .sqlite button to keep it.
Tables in the database
No database yet. Run a script that creates a table, or open a SQLite file of up to 10 MB.
Examples
Each one loads into the editor, and the result beside it is what running it gives.
- 2 joined rows: Ada 19.5, Grace 42.75
- SELECT COUNT(*) FROM orders still returns 3
- stopped at 2 s, the database as it was before the run
- 3 rows, running_total 120, 200, 400
- free 1, pro 1
What SQLite here can and cannot do
The engine is the real SQLite. These are the edges this page adds or keeps.
- MySQL, PostgreSQL and SQL Server features that SQLite lacks fail with SQLite's own message, and SHOW, DESCRIBE, NOW(), GETDATE(), SELECT TOP and the shell's dot commands get a hint naming the SQLite way.
- ATTACH and DETACH are turned off, and nothing here connects to a server or to any other database.
- load_extension() does not exist in this build, so no extension can be loaded.
- A run that takes longer is stopped: its worker is replaced and the database goes back to how it was before the run.
- Each result shows up to 1,000 rows, a run shows up to 20 results and 50,000 values in all, and a text value shows its first 1,000 characters. A note marks anything cut.
- SQLite may use up to 128 MB of memory, and a database stays within 10 MB: an INSERT that would pass it fails with database or disk is full, and a run that ends larger is not kept.
- Each run starts a new SQLite, so a CREATE TEMP TABLE is gone when its run ends. Use a normal table with Current database to keep data.
Engine and licence
SQLite is in the public domain (sqlite.org/copyright.html). It is compiled to WebAssembly by sql.js 1.14.2, MIT licensed by the sql.js authors, whose JavaScript this page bundles. Both load the first time you run a script or open a file. The engine file is served from this site unmodified; the licence file holds the complete sql.js notice.
| File | What it is | Size | Licence | SHA-256 |
|---|---|---|---|---|
| sql-wasm.wasm | SQLite 3.49.1 compiled to WebAssembly by sql.js, package/dist/sql-wasm.wasm (downloaded when first needed) | 658,410 bytes | MIT (sql.js); SQLite itself is public domain | 38c14f6e379210bc942bdc4ebca44e7bfdb4318ecc1c72ca666a28fdce96670a |
| sqljs-LICENSE.txt | The sql.js licence notice, package/LICENSE | 2,199 bytes | MIT | 60a3f6e4d7b29b4321359e683b36cf198d24f58e24582070f56e6fa89d5ee2be |
Databases up to 10 MB (10,485,760 bytes) open from your device and are never uploaded.
Common questions
- Does it download a real SQLite database file?
- Yes. The .sqlite button exports the current SQLite database bytes, which can be opened by a compatible SQLite application. The sample creates a notes table and row before download.
- Can I turn a .sql script into a SQLite database?
- Paste the text of a SQLite-compatible script into the editor, choose Empty database, and press Run. Download the resulting database after reviewing any errors. There is no .sql file chooser and no automatic conversion from another SQL dialect.
- Can I import CSV, Excel or JSON files?
- There is no direct file importer for those formats. This workflow takes SQL statements, or an existing SQLite database file. Write compatible INSERT statements yourself if you want to load tabular data.
- Will the database be hosted online?
- No. It lives in browser memory for this visit. Download it to keep it; Reset or closing the page discards the browser copy.
Runs the SQLite dialect only, SQLite 3.49.1 through sql.js 1.14.2, in a worker in your browser: there is no connection to MySQL, PostgreSQL or any other database, and extensions cannot be loaded. Every run gets a fresh worker that is stopped at 2 seconds, and each result shows its first 1,000 rows at most, with a note when rows were cut. Scripts up to 64 KB and database files up to 10 MB stay on your device.