Skip to content

Simple and advanced modes

The playground has two input modes. You can do everything a beginner needs in simple mode, and reach for advanced mode when you want full SQL.

The same command in both modes — advanced mode also shows the SQL it runs for you.

Simple mode is a friendly, keyword-based command language designed for learning. Commands read close to English:

create table authors with pk author_id(serial)
show data authors

Simple mode accepts these learning commands plus the app-level commands (like save, undo, and help). If you type raw SQL here, the playground gently points you at advanced mode instead of failing silently.

Advanced mode accepts standard SQL — SELECT, INSERT, CREATE TABLE, and more — alongside the same app-level commands:

select title, published from books where published >= 2000 order by published;

Switch modes with the mode command:

mode advanced
mode simple

The mode you leave a project in is remembered and restored the next time you open it, so a project set up for SQL practice reopens in advanced mode.

When you are in simple mode and want to run a single SQL statement without switching, prefix the line with a colon:

:select count(*) from books

That runs just this one line as SQL; you stay in simple mode afterwards.

Run a simple-mode command while in advanced mode and the playground prints the equivalent SQL beneath it, tagged Executing SQL:. This is one of the most useful ways the playground teaches: you write the friendly, readable command, and immediately see the real SQL statement it stands for — the same statement you could have typed yourself.

It turns every command into a small SQL lesson. Add a column the easy way and watch the ALTER TABLE it maps to:

add column to books: title (text)
Executing SQL: ALTER TABLE books ADD COLUMN title text

The payoff grows with the command. A single create m:n relationship — the one-line way to link two tables many-to-many — expands to an entire junction table: two foreign-key columns, a compound primary key, and two cascading foreign keys, all spelled out in the echo.

Simple-mode commands run in advanced mode each echo the SQL they run — ending with the m:n command expanding to a full junction table.

Because the echo is exactly what runs, it doubles as a recipe: read it, copy it, tweak it, and run your own version in advanced mode.