PostgreSQL playground
Write SQL and run it right here. A small database is ready to query, and you can create your own tables too. It runs in your browser: no sign-up, nothing to install, and nothing you type is sent anywhere.
What you can do here
- Try a query before you use it at work or in an interview: joins, GROUP BY, window functions and common table expressions all work.
- Create your own tables with CREATE TABLE and INSERT, then query them. Reset brings the starting tables back.
- Check what a query returns on a small table you can read in full, which is the fastest way to find a mistake.
Which SQL is this?
The playground runs PostgreSQL. The core of SQL (SELECT, WHERE, JOIN, GROUP BY, HAVING, subqueries, window functions) is the same in MySQL and SQL Server. Date and string functions differ between databases; here dates are real DATE values and you work with them using to_char, EXTRACT and date arithmetic such as order_date + 7.
Want to be checked, not just run?
The playground runs whatever you write. To find out whether a query is actually right, the practice exercises give you a task and check your answer on visible and hidden data, and the free SQL practice test scores you on ten questions in 15 minutes. The SQL cheat sheet has the syntax in one place.
Practice SQL with instant checking