Skip to main content

What you learn

LevelFrom beginner to advanced

Concepts you practice

  1. SELECT · WHERE · ANDBeginner
  2. INSERTBeginner
  3. UPDATE · DELETEBeginner
  4. CREATE TABLE · types · PRIMARY KEYIntermediate
  5. NOT NULL · CHECK · DEFAULT · FOREIGN KEYIntermediate
  6. BEGIN · COMMIT · ROLLBACKAdvanced

FOG HARBOR

A rescue written in SQL

The harbor ledger got soaked, a storm is coming and boats are still at sea. You build the database that brings them home.

About the game

A rescue written in SQL

A free game to learn SQL from scratch in your browser. Marta, the harbor master, retires on the day the tide soaks her ledger and a storm rolls in with boats still at sea. You move the harbor into a database: you query it, add the boat nobody wrote down, fix rows, delete the duplicate, create tables with rules and move the rescue fuel in a transaction.

From your first SELECT to transactions
11 steps
MySQL, PostgreSQL, SQLite and SQL Server
Standard SQL
In your browser, nothing to install
Free

What you learn in the harbor

  1. SELECT · WHERE · AND

    You look at the table and filter who is still at sea.

    Beginner

  2. INSERT

    You register the boat that wasn't in the ledger.

    Beginner

  3. UPDATE · DELETE

    You fix rows and delete a duplicate without touching the rest.

    Beginner

  4. CREATE TABLE · types · PRIMARY KEY

    You create new tables for the radio notices.

    Intermediate

  5. NOT NULL · CHECK · DEFAULT · FOREIGN KEY

    You set rules so the database rejects bad data.

    Intermediate

  6. BEGIN · COMMIT · ROLLBACK

    You move fuel in a transaction: all or nothing.

    Advanced

How to play

  1. Read the scene

    Move the dialogue on to find out what the harbor needs.

    EnterSpaceClick

  2. Write the statement

    Type it in the SQL console and run it.

    CtrlEnter

  3. The harbor answers

    The game checks how the tables ended up, with no answers to type. If something goes wrong, it explains what happened and undoes the step. Every step has two hints and the solution.

Frequently asked questions

Short answers before you start playing.

Do I need to know SQL or how to code?

No. The game starts with your first SELECT and explains each command before asking for it. Every step has two hints and, if you get stuck, the solution ready to run.

Does it work for MySQL, PostgreSQL, SQLite or SQL Server?

Yes. The game teaches and accepts standard SQL, the kind that works the same in MySQL, PostgreSQL, SQLite and SQL Server. Where an engine writes something differently, the explanation says so: for example, SQL Server opens a transaction with BEGIN TRANSACTION, and the game accepts that form too.

How is it different from Signal Lost?

Fog Harbor teaches you to create and look after data (INSERT, UPDATE, DELETE, CREATE TABLE, keys, constraints and transactions) from scratch. Signal Lost teaches you to investigate existing data with JOIN, GROUP BY and window functions. Play Fog Harbor first.

Is it free? Do I need an account?

It's free and runs in your browser, on a computer or phone, with nothing to install and no account. Your progress is saved in that browser.

Which database does it use?

A SQL database that runs inside your browser. Your statements never leave your device and you can undo any step whenever you like.

What comes after the game?

Iterixs's SQL Fundamentals course teaches everything you used in the harbor step by step, and Signal Lost is waiting with more advanced queries to investigate.

Keep learning

Take your SQL further

To save the harbor you query, insert, fix rows, create tables with rules and use a transaction. These courses teach each step from scratch, with real SQL you run in the browser.

What the game practices

  • SELECT · WHERE · AND
  • INSERT
  • UPDATE · DELETE
  • CREATE TABLE · types · PRIMARY KEY
  • NOT NULL · CHECK · DEFAULT · FOREIGN KEY
  • BEGIN · COMMIT · ROLLBACK
  1. Start here

    SQL for data analysis

    Learn SQL from your very first query by answering real questions about an online store's database. You start by reading a table and finish by building a sales report: you choose columns, filter, sort, summarize with GROUP BY and join tables with JOIN. Along the way you learn to watch for three things that change a number without warning: missing data, duplicate rows and what each row represents. Everything runs in the browser with nothing to install, and every lesson includes self-grading exercises.

    22 lessonsView course

  2. Next step

    Design and build an app's database

    Step by step, you design and build the database that replaces a yoga and climbing studio's spreadsheet: tables, relationships, rules that block bad data, safe changes, transactions and indexes. Every lesson runs real SQL on the page from the very first minute.

    23 lessonsView course

  3. Next step

    Analytical SQL: CTEs and window functions

    Answer the business questions a simple aggregation can't reach: rankings, top-N per group, running totals, month-over-month changes, cohorts and hierarchies. You work on a store's sales database, run every query right in the lesson, fix badly partitioned windows and finish with a challenge on tables you've never seen.

    28 lessonsView course

Courses with hands-on practice in the browser, from the first step to advanced.

See every SQL course

More games to learn with