Playcode Classic

SQL Playground

This SQL playground is an online SQL sandbox, PostgreSQL 17 in your browser, with a small sample database already loaded: a music store with artists, albums, tracks, customers and invoices. Write a query, press Run and read the result as a table. Nothing to install and no account to start. It’s part of Playcode Classic, Playcode’s free code tools.

Free. No account needed to start.

In a record shop set up on a playground, an analyst on a stool writes a query on her laptop while Play holds one vinyl record high above the crates; a rocket waits beyond the fence.

A database with data already in it

A small music store in PostgreSQL. Join albums to artists, group tracks by genre, total invoices by country.

The sample database has six tables, shown with their main columns. artists: artist_id, name. albums: album_id, title, and artist_id, which points to artists. tracks: track_id, name, album_id, genre_id and unit_price; album_id points to albums and genre_id to genres. genres: genre_id, name. customers: customer_id, first_name, last_name, country, email. invoices: invoice_id, customer_id, invoice_date and total; customer_id points to customers.
  • artists
    • artist_id
    • name
  • albums
    • album_id
    • title
    • artist_id
  • tracks
    • track_id
    • name
    • album_id
    • genre_id
    • unit_price
  • customers
    • customer_id
    • first_name
    • last_name
    • country
    • email
  • invoices
    • invoice_id
    • customer_id
    • invoice_date
    • total
  • genres
    • genre_id
    • name
At a playground snack counter Play, in a little server’s cap, slides three trays toward the analyst, each tray holding a small table of coloured cells.

Every query gets its own table.

Write several queries and press Run once: each SELECT comes back as its own table, in order. INSERT, UPDATE and CREATE say OK.

Click a table to query it.

The panel beside your code lists your tables and columns, primary keys marked. Click one and the editor writes the SELECT for you.

Close the tab. Your tables wait.

Your database lives in this browser, so the tables you make are still there next time. Reset to the music store, or start with an empty database.

A shared link opens your queries, not your data: each browser has its own database.

Two halves of one picture: at dusk under the moon Play closes a toy chest full of stacked blocks, and at sunrise he opens it and every block is where he left it.

It’s PostgreSQL

Works

  • Joins, GROUP BY and HAVING
  • Window functions and common table expressions (WITH)
  • JSON and arrays
  • CREATE TABLE, INSERT, UPDATE and DELETE
  • pgvector, for embeddings

Not here (yet)

  • MySQL-only syntax, such as AUTO_INCREMENT or LIMIT 5, 10
  • SQL Server syntax, such as TOP
  • Extensions other than pgvector
  • Functions and triggers with several statements in their body
  • Importing a CSV file

Describe it. Get the query.

Ask the editor’s AI chat in plain words, for example the five customers who spent the most, and it writes the SQL. It sees your errors too. It uses credits; eligible new accounts get trial credits.

In the record shop the analyst has a small bar chart on her laptop, and Play presents five records he has stood in a row on the counter, tallest first.

Part of Playcode Classic

Playcode began in 2016 as a browser coding environment. This playground is one of its free code tools, which we now call Playcode Classic.

Playcode today is an AI platform for building and running websites and apps.

Play stands at the open gate of an old playground and presents what lies beyond it: a rocket ready on its launch pad.

Questions people ask

  • Is this online SQL playground free?

    Yes. Running queries is free and needs no account. Saving and sharing need a free account, which keeps up to three saved projects, public or private; the AI chat uses credits.

  • Which database does it run?

    PostgreSQL 17, compiled to WebAssembly, running in your browser.

  • Does it come with sample data?

    Yes. It’s a SQL playground with data already in it, a small sample: the Chinook music store, with artists, albums, tracks, genres, customers and invoices. Reset to it at any time, or start with an empty database.

  • Can I use MySQL or SQL Server syntax?

    Only where it matches PostgreSQL. Standard SELECT, JOIN, GROUP BY and window functions work; MySQL- or SQL Server-only syntax, such as AUTO_INCREMENT or TOP, doesn’t.

  • Do my tables stay after I close the tab?

    Yes, in this browser. The database is stored in your browser, so another browser or device starts fresh, and a shared link shares your queries, not your data.

  • Can I create my own tables?

    Yes. CREATE TABLE, INSERT, UPDATE and DELETE all work.

  • Can I import a CSV file?

    Not yet. Paste SQL statements into the editor and run them.

  • Does it support pgvector?

    Yes: CREATE EXTENSION vector works. Other extensions aren’t available yet.

  • Can I practise SQL here?

    Yes. Write queries against the music store: join albums to artists, group tracks by genre, total invoices by country.

  • Is this playground part of Playcode?

    Yes. This playground is part of Playcode Classic, Playcode’s free code tools. Playcode began in 2016 as a browser coding environment. Today it is an AI platform for building and running websites and apps.

More free code tools

Ask the database something.

A rocket waits with its door open and an empty seat, and Play invites you in. High above, another rocket climbs away.