Skip to content

Developer tools

SQL Playground: Run SQL Queries Online

Write SQL and run it straight away against sample tables, or create your own. It runs SQLite in your browser, so it is fast, private and free.

Try:

Tables

Loading SQLite…

No tables yet. Create one with CREATE TABLE.

How to use the SQL Playground: Run SQL Queries Online

  1. 1

    Pick a sample database: an online shop, or a company with employees and departments for interview practice.

  2. 2

    Write a query, or press one of the examples, then press Run (Ctrl + Enter).

  3. 3

    Change the data with INSERT, UPDATE or CREATE TABLE. Reset data puts the sample tables back.

  4. 4

    Copy a result as CSV, or use "Copy link to this result" to share your query.

Frequently asked questions

Which database does it use?
SQLite, running in your browser through WebAssembly. Most everyday SQL works the same in MySQL, MariaDB and PostgreSQL: SELECT, JOIN, GROUP BY, subqueries, CTEs and window functions.
How is it different from MySQL?
A few things differ: use || to join strings instead of CONCAT(), date functions are date() and strftime() instead of DATE_FORMAT(), and column types are flexible. AUTO_INCREMENT is written AUTOINCREMENT.
Is my SQL or data sent anywhere?
No. Queries run on your device and are never uploaded. Your changes last until you press Reset data or reload the page.
Can it practise interview questions?
Yes. The Company database has employees, managers, salaries and departments, with examples for the classic questions: second-highest salary, self joins, top earner per department and duplicates.
What happens if my query never ends?
Queries are stopped after 5 seconds, for example a recursive CTE without an end, and the sample data is reset.

Embed this tool on your site

Paste this code into your page. It's free, with no sign-up, ads or cookies.

Preview

Please keep the "Powered by Dev-Talk" link.

Practise with SQL challenges

All SQL challenges

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.