A FREE GAME TO LEARN SQL

LE PETIT JOURNAL
PARIS — 18 MAY 1912 — FIVE CENTIMES

THE BLUE STAR VANISHES FROM THE RITZ

A calling card signed A. L., lying on a white damask pillow with gold tassels
The pillow, as the maid found it. Photograph: Prefecture of Police.

A calling card signed A. L. was found on the pillow of the Comtesse de Cagliostro.
Inspector Ganimard, summoned in the night, has promised an arrest before the week is out. He has also, we are told, hired a clerk.

You are the clerk. Your only weapon is SQL.

New to SQL? Try a two-minute warm-up first →

Loading the archives...

ABOUT THIS GAME

The Ritz Affair is a detective story you play by writing SQL. Paris, May 1912: the Blue Star, a famous sapphire, has vanished from the Hotel Ritz, and Inspector Ganimard needs a clerk who can read his archives. The archives are a SQLite database that runs entirely in your browser. There is nothing to install and no account to create, and in learning mode nothing you type is sent to a server.

It is written for students of a first SQL course, and for teachers who want a graded or timed class session built on real queries rather than multiple-choice questions. Each chapter practises one construct, from a plain SELECT to a recursive query.

A chapter works the same way every time. You read the story and the objective, then query the archives: police reports, the hotel register, cab rides, telegrams, bank transfers. When you think you have it, you type the answer. A correct answer opens the next chapter and reveals its tables in the schema beside the terminal. In learning mode a wrong one costs nothing but pride.

ChapterSQL practised
I. The Night of the 17thSELECT / WHERE
II. The Neighbouring SuiteORDER BY / LIMIT
III. A Plate in the DarkLIKE
IV. The Cab's WeekGROUP BY / HAVING
V. The Boarding HouseJOIN
VI. Follow the Francsthree JOINs, SUM and HAVING
VII. The Quietest HourCASE WHEN with GROUP BY
VIII. The First Order Before DawnRANK() OVER and a CTE
IX. The TrunkCTE and JOIN
X. Never Seen TogetherSelf-join
XI. The SilenceLAG() OVER
XII. Follow the MoneyWITH RECURSIVE

After chapter VIII the paper switches to its night edition: Part II follows the case after dark through four more chapters and new tables.

In compete mode a teacher hands out a season link; each player picks a pseudo, the teacher starts every clock at once, and a class leaderboard ranks everyone by time.

The story borrows Arsene Lupin, Ganimard, the Comtesse de Cagliostro and the names Sernine and Velmont from Maurice Leblanc. Everyone else in the archives is invented, and every name, sum and timetable in the database is fictional. The jokes hidden among its rows are deliberate. For the SQL itself, The Clerk's Handbook explains every construct the chapters use, on a separate example database.

Privacy notice · The Clerk's Desk · AlephB · Contact

LE PETIT JOURNAL
TERMINALCtrl+Enter runTab completeCtrl+F formatShift+Tab leave the boxPostgreSQL
ANSWER

HISTORY
    A NEW OBJECTIVE

    PART II
    The case is not closed

    Lupin mentioned a Chapter IX. Somewhere in the archives a telegram is addressed to a curious clerk; its code, typed in the answer box...

    COMPETE

    THE SESSION IS OVER

    The teacher has closed the session. Your time is recorded up to this point.

    See the results
    A FRESH START

    New investigation

    CERTIFICATE

    For the record


    BEFORE THE INSPECTOR ARRIVES

    The clerk's first morning

    The head porter hands you the hotel's lost-property book while Ganimard finishes his coffee. Practise on it: nothing in it is evidence.

    ADMIN