SQL playground
An online SQL editor with a sample store database already loaded. Write any query, run it with Ctrl + Enter and see the rows. You don't need an account, and there is nothing to install.
Opening the workspace
Opening the workspace
What you can try
- Filter and sort:
SELECT name, price FROM products WHERE category = 'Kitchen' ORDER BY price DESC; - Count and total by group with
GROUP BY, then keep only the big groups withHAVING. - Join
orderstocustomersto see who bought what, then use aLEFT JOINto find customers with no orders. - Rank products inside each category:
RANK() OVER (PARTITION BY category ORDER BY price DESC). - Build monthly revenue with a
WITHclause andDATE_TRUNC('month', order_date). - Find employees who earn more than their manager by joining
employeesto itself.
The sample data
Kestrel, a fictional online store for home and kitchen goods, in five tables: products (price, cost and stock), customers (city, country and loyalty tier), orders (dates, status, coupon code and total), order_items (one row per product in an order) and employees (department, manager and salary). Open Tables to see every column, and click a table name to preview its rows.
Learn it step by step
The playground checks nothing. In the course, lessons come in order and every exercise is checked the moment you finish it, with a hint that names the mistake. The first unit is free.
Course: SQLLesson 1: SELECT: choose the columns you needLesson 2: WHERE: keep only the rows you wantLesson 9: GROUP BY: totals for each groupLesson 43: Window functions: ROW_NUMBER, RANK and DENSE_RANKLesson 33: CTEs: name a step with WITHTest your level
Questions about the playground
Which SQL dialect does it run?
DuckDB, which follows standard SQL closely: joins, GROUP BY, window functions, CTEs, CASE and date functions work the way they do in PostgreSQL for most queries. Syntax that only one product has, such as SQL Server's TOP, may not run; use LIMIT instead.
Does the database run on a server?
No. The database engine runs inside your browser tab, so your queries never leave your computer and a slow query cannot affect anyone else.
Can I open my own CSV?
Yes. Open Your own CSV above the workspace and choose Open CSV. Use comma-separated UTF-8 text with a header, up to 512 KB, 2,000 data rows, 50 columns and 25,000 cells including the header. You can save named projects in this browser or download the current data as CSV. These saves do not sync to your account. XLSX is not supported.
Is the SQL playground free?
Yes. You don't need an account or a card, and it runs in your browser, so there is nothing to install.
Is my work saved?
Only in this browser. The playground keeps your last session on this device so it is there when you come back, and sends nothing to an account. Start again puts the sample data back.
Other playgrounds
- Python playground
A Python notebook with pandas and sample CSV files, running in your browser.
- Excel practice sheet online
A spreadsheet that works like Excel, with 30 sample orders for formulas, pivots and charts.
- Linux terminal online
A Bash-style terminal with sample logs, a CSV and a config file to practice commands on.
- Power BI playground: practice DAX
Write DAX measures on a sample sales model and see them in a visual.
- Power Query online playground
Clean and reshape messy sample files in a Power Query Editor.
- Git playground
A sample repository with branches and commits to practice Git commands on.