SQL Online: SQL Editor With SQLite

Practice and run SQL online with a full SQLite database that runs right in your browser. Start with the built-in sample tables or create your own, write SELECT, JOIN and GROUP BY queries, and see the results in a clean table. It is great for learning SQL or testing a query fast.

SQL Online

Write and run SQL queries in your browser with a real SQLite database. Free, no sign up.

Tables

Loading SQLite…
Query history
Everything runs in your browser. Your files are never uploaded to a server.

How to use the SQL Online

  1. Type a query in the editor, for example SELECT * FROM customers LIMIT 10;
  2. Press Run or Ctrl+Enter. To run only part of the script, select it first.
  3. See the results in a sortable table. Multiple statements each get their own result tab.
  4. Click a table in the schema panel to preview it or insert its name into your query.
  5. Import a CSV as a new table, or open a SQLite .db file.
  6. Export results to CSV or JSON, or download the whole database as a .sqlite file.

Features

  • Real SQLite engine running in your browser, with joins, CTEs, window functions and more
  • Sample store database with customers, products, orders and order items
  • Schema browser with columns, types and row counts
  • Run all, run selection, and run one statement at a time
  • Results table with sorting, row counts and timing
  • Import CSV files as tables and open .db, .sqlite and .sql files
  • Export results to CSV or JSON, and download the database file
  • Query history and 8 example queries to learn from
  • Your database and script are saved in your browser

Frequently asked questions

Which SQL dialect does this use?

It uses SQLite, which supports standard SQL including joins, subqueries, CTEs, window functions, views and triggers.

Is my data uploaded anywhere?

No. The database engine runs entirely in your browser. Your files and queries stay on your device.

Can I open my own database?

Yes. Click Open file and choose a SQLite .db or .sqlite file, or a .sql script. You can also import CSV files as new tables.

Is this good for learning SQL?

Yes. The sample store database and example queries cover SELECT, WHERE, JOIN, GROUP BY, subqueries and window functions.

Will my tables still be there tomorrow?

Your database is saved in this browser automatically if it is under about 3 MB. For bigger databases, use Download DB to keep a copy.

Can I export the results?

Yes. Export the current result as CSV or JSON, or copy it to paste into a spreadsheet.

See also: SQL Formatter, Online Spreadsheet, CSV to JSON, JSON Formatter, Online HTML Editor.

Run SQL queries in your browser

How to use it

  1. Load the sample database or create a table.
  2. Type a SQL query in the editor.
  3. Press Run to see the results.
  4. Export results or save the database file.

More questions

Related tools: SQL Formatter, JSON Formatter & Validator, Online Spreadsheet.

What is in the sample database

Write a query and press Run or Ctrl+Enter. The built-in store database has customers, products, orders and order_items tables plus an order_totals view, and Reset restores it. Export results as CSV, JSON or Copy, or download the database as a .sqlite file. To turn a CSV into an Excel file, use the CSV to Excel Converter.

Worked example: the sample holds 30 customers, 20 products, 120 orders and 311 order items. The default query lists customers by order count and puts Sofia Tanaka (India) first with 9 orders. Orders by status are delivered 65, shipped 21, processing 19 and canceled 15, which adds to 120, and 105 orders remain after you exclude canceled ones.

More answers

How do I count rows for each status?

Run SELECT status, COUNT(*) FROM orders GROUP BY status; and the sample returns delivered 65, shipped 21, processing 19 and canceled 15. The four numbers add up to the 120 orders in the table.

What happens when I import a CSV file?

The tool creates a table from the file and runs SELECT * on it with a limit of 100 rows, so you see the data at once. Your imported table sits next to the sample tables, and the empty database option starts with none of them.