Online SQL Editor
Online SQL Editor · Examples & offline guide
Online SQL Editor
Create tables, insert data, and run SQLite queries directly in your browser with local execution and automatically saved drafts. Use this free SQL online editor to practice programs without installing software, then keep coding offline after the editor and runtime show “Available offline”.
Practice SQL / SQLite programs in this playground
Use this SQL playground as an online SQLite editor to practice SELECT statements, JOIN queries, GROUP BY, and aggregate functions. Create sample tables and insert data to test SQL queries without setting up a database server.
How to run SQL / SQLite online
Edit the starter program, choose Run, and read the output. No account or installation is required. Execution uses SQLite · sql.js on your device.
SQL / SQLite example program
-- A small project tracker with linked tables.
PRAGMA foreign_keys = ON;
CREATE TABLE teams (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
region TEXT NOT NULL
);
CREATE TABLE people (
id INTEGER PRIMARY KEY,
team_id INTEGER NOT NULL REFERENCES teams(id),
name TEXT NOT NULL,
role TEXT NOT NULL
);
CREATE TABLE projects (
id INTEGER PRIMARY KEY,
team_id INTEGER NOT NULL REFERENCES teams(id),
owner_id INTEGER NOT NULL REFERENCES people(id),
name TEXT NOT NULL,
status TEXT NOT NULL
);
INSERT INTO teams VALUES
(1, 'Field Notes', 'West'),
(2, 'Night Shift', 'East');
INSERT INTO people VALUES
(1, 1, 'Ari Kim', 'Designer'),
(2, 1, 'Sam Reed', 'Engineer'),
(3, 2, 'Dev Malik', 'Researcher');
INSERT INTO projects VALUES
(1, 1, 1, 'A new beginning', 'In progress'),
(2, 1, 2, 'Archive search', 'Planning'),
(3, 2, 3, 'Quiet hours', 'In progress');
SELECT projects.name AS project, teams.name AS team,
people.name AS owner, projects.status
FROM projects
JOIN teams ON teams.id = projects.team_id
JOIN people ON people.id = projects.owner_id
ORDER BY projects.id;
Questions about this editor
How do I use this SQL online editor?
Start with the example or write your own SQL program, choose Run, and view the output. BrowserCode uses SQLite · sql.js for local execution in your browser. The playground is free and does not require an account.
Can I run SQL online without installing a compiler or interpreter?
Yes. This browser-based SQL playground loads the bundled SQLite · sql.js runtime for you. Edit a program and choose Run to test it locally. The supported features and limitations are listed below.
Which SQL queries can I practice?
Practice SQLite SELECT queries, joins, aggregations, CREATE TABLE, INSERT, UPDATE, and DELETE statements. Separate PostgreSQL and DuckDB editors are also available in the language catalogue.
Can I use this SQL editor offline?
Yes. Open this language while connected and wait for “Available offline” before disconnecting. The editor and language runtime must finish saving to browser storage. You can then edit and run code offline in this browser. Clearing site data or browser storage eviction removes saved downloads. Optional cloud sync and AI need internet access.
What are the limits of running SQL in a browser?
An in-memory SQLite database, recreated on each run. Run CREATE, INSERT, and SELECT together. No external databases, extensions, file import, or network access.
Is my code private and saved?
Code execution and free drafts stay on your device. Drafts are saved in this browser; download files to keep a separate copy. Optional paid Supporter cloud sync and AI send the work or context you choose to share and require an internet connection.