SQL Playground
PostgreSQL 18, in your browser
Practise on a real PostgreSQL database instead of a simulator. Write any query, from your first SELECT to window functions, CTEs and JSON, and see what the database really returns. Nothing to install.
2 rowsResult 1
| topic | total |
|---|---|
| joins | 65 |
| window functions | 30 |
CREATE TABLE practice
(topic text, minutes int);
INSERT INTO practice VALUES
('joins', 25), ('joins', 40),
('window functions', 30);
SELECT topic, sum(minutes) AS total
FROM practice GROUP BY topic
ORDER BY total DESC;SQL PlaygroundPostgreSQL 18a query in My database
What's inside
Shared practice tables
Ready-made tables on the server, to query from your first SELECT. They are read-only, so nothing you run can break them.
Your own private database
My database is PostgreSQL running in your browser: create tables, views, indexes, roles and functions, with no row or table limits. Nobody else can see it. Export it to a .sql file to keep it, because clearing this site's data in your browser deletes it.
A real editor. Up to five query tabs with SQL highlighting, saved to your account, so they follow you to any computer.
Schema explorer. Browse every table and column, and drop names into your query with a click.
Run history. Your last ten runs are kept, so you can go back to a query that worked.
Download results. See the first 100 rows on screen and download up to 10,000 as CSV.
How to get in
- Have Think in SQL?
- The code printed in it gives 180 days of access, free.
- No book?
- Buy a code for , GST included, for 3 months.
- Teaching a college or adult class?
- Buy one group code for everyone, off. Each student signs up with their own email address.
One code opens every playground, and your time starts the day you create your account with it. Pricing
Fair-use limits
They keep the playground quick for everyone sharing it.
- On the shared tables, each statement may run for up to 10 seconds.
- Up to 30 runs a minute and 1,500 a day on the shared tables. Runs in your own database, in your browser, are not counted.
- Your own database has no row or table limits; it can use whatever storage your browser gives the site.
- Up to 50 statements and 50,000 characters in one run.

Written for this playground: Think in SQL
Every query the book prints runs here, numbered as in the book. The code printed in it gives 180 days of access, free.