Story campaign - Chapter 9

Learn LEFT JOIN: THE DEEP

Several operatives are drawing salaries with no assignment on record. Either they are ghosts on the payroll, or their work is too classified to log.

Mission briefing

THE DEEP is chapter 9 and the LEFT JOIN chapter. An INNER JOIN would silently drop the very rows you are hunting, so you join OPERATIVES to ASSIGNMENTS with LEFT JOIN, keeping every operative whether or not a matching assignment exists.

The unmatched rows come back with NULL in the assignment columns, and filtering on IS NULL exposes the phantoms. This find-the-missing-rows pattern, sometimes called an anti-join, shows up constantly in real audits and in data interviews.

Two missions, one table pair, and a habit worth keeping: always ask which rows an inner join would lose.

A query pattern from this chapter

This is the shape of query you practice here, not the answer to any mission. The real stages come with their own data, objectives, and hints.

SELECT OPERATIVES.CODENAME
FROM OPERATIVES
LEFT JOIN ASSIGNMENTS ON OPERATIVES.ID = ASSIGNMENTS.OPERATIVE_ID
WHERE ASSIGNMENTS.OPERATIVE_ID IS NULL;

Related guides

Play Deep now

Free in your browser, desktop only. Guest mode starts instantly with no signup; sign in with Google if you want progress saved across devices.

Play free