Write SQL. See Real Results. No Setup.
AI chatbots can write SQL, but they cannot run it. This playground executes SQLite 3.x in your browser via WebAssembly (sql.js). Pre-loaded with Chinook, Northwind, and Employee sample databases. 100% private, no signup, no server.
Run a query to see results
Click "Explain Query Plan" to see the execution plan
Select a sample database (Chinook, Northwind, Employee) or start empty. Write SQL in the editor using CodeMirror with syntax highlighting. Click Run (Ctrl+Enter) to execute against SQLite 3.x compiled to WebAssembly via sql.js. Results appear in a paginated, sortable table. Export to CSV, JSON, or SQL INSERT statements. View the EXPLAIN query plan to understand performance.
AI can write SQL queries, but it cannot execute them against real data. When you ask an AI to test a query, it hallucinates the result based on training patterns, often missing edge cases, NULL handling, or index usage. This playground runs your SQL for real so you see the exact rows, the actual errors, and the actual query plan — essential for debugging and learning.
Learn SQL with interactive examples, prototype queries before running on production, test JOINs and window functions on real data, debug a query that AI wrote, teach SQL in a classroom without installing anything, share a query via URL for collaboration. All without a database server.
Your queries and data never leave your browser. SQLite runs in WebAssembly memory. Optional localStorage persistence stays local to your browser. Close the tab and everything is gone unless you explicitly save. Share links encode the SQL in the URL hash — do not share links containing sensitive data.
Sample Queries to Try
SELECT ar.Name AS Artist, SUM(il.UnitPrice * il.Quantity) AS Revenue
FROM InvoiceLine il
JOIN Track t ON il.TrackId = t.TrackId
JOIN Album al ON t.AlbumId = al.AlbumId
JOIN Artist ar ON al.ArtistId = ar.ArtistId
GROUP BY ar.ArtistId
ORDER BY Revenue DESC
LIMIT 10;
SELECT c.CompanyName, COUNT(o.OrderID) AS Orders,
SUM(od.UnitPrice * od.Quantity * (1 - od.Discount)) AS TotalSpent
FROM Customers c
JOIN Orders o ON c.CustomerID = o.CustomerID
JOIN [Order Details] od ON o.OrderID = od.OrderID
GROUP BY c.CustomerID
ORDER BY TotalSpent DESC
LIMIT 15;
WITH RECURSIVE hierarchy AS (
SELECT EmployeeID, FirstName, LastName, ReportsTo, 0 AS Level,
CAST(FirstName || ' ' || LastName AS TEXT) AS Path
FROM Employees WHERE ReportsTo IS NULL
UNION ALL
SELECT e.EmployeeID, e.FirstName, e.LastName, e.ReportsTo, h.Level + 1,
h.Path || ' > ' || e.FirstName || ' ' || e.LastName
FROM Employees e JOIN hierarchy h ON e.ReportsTo = h.EmployeeID
)
SELECT Level, Path FROM hierarchy ORDER BY Path;
Frequently Asked Questions
Is the Online SQL Playground really free?
Yes. No signup, no credit card, no daily limits. Unlike SQLFiddle, DB Fiddle, or Mode, this playground runs SQLite entirely in your browser via WebAssembly. There are no server costs, so no usage caps.
How does SQLite run in the browser without a server?
The playground uses sql.js, which is SQLite compiled to WebAssembly. WebAssembly is a portable binary format that all major browsers execute at near-native speed. The database lives in memory (or localStorage for persistence) and SQL executes directly in your browser tab.
Which SQL dialect does it support?
SQLite 3.x dialect. This covers most standard SQL: SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, CREATE INDEX, VIEWs, CTEs (WITH), window functions, JSON1 extension, FTS5 full-text search. MySQL/PostgreSQL-specific syntax (e.g., LIMIT ... OFFSET vs FETCH) may differ slightly.
What sample databases are included?
Three classic datasets: Chinook (digital media shop - artists, albums, tracks, invoices), Northwind (orders, customers, products, employees), and Employee (company org chart with self-referencing manager hierarchy). You can also create your own tables or load SQL from a file.
Can AI replace this tool?
No. AI can write SQL, but it cannot execute it against real data. When you ask an AI to test a query, it hallucinates the result. This playground runs your SQL for real against actual data so you see the exact rows, the actual errors, and the actual query plan.
Is my data saved or sent to a server?
No. Your queries and data stay in your browser. The SQLite database runs in WebAssembly memory. You can optionally persist to localStorage (local to your browser). Close the tab and everything is gone unless you explicitly save. You can share a query via URL hash which encodes the SQL in the link itself.
Can I use this for large datasets?
The browser memory limit applies (typically 2-4 GB). The sample databases are small (~1-5 MB). For larger datasets, consider a local database. This tool is designed for learning, prototyping, and testing queries on small-to-medium data.
Comments & Ratings