Learn DISTINCT and CASE WHEN: THE EXCHANGE
Counterintelligence suspects several operatives are playing both sides. The records are full of duplicates, and allegiance has to be judged from behavior, not labels.
Mission briefing
THE EXCHANGE is chapter 4. Its missions run on the OPERATIVES table: CODENAME, POSTING, LOYALTY_SCORE, MISSIONS_COMPLETED, and YEARS_ACTIVE. Multiple operatives share the same stations, so the first job is SELECT DISTINCT to collapse duplicate postings into a clean list.
Then comes conditional logic. Using CASE WHEN, you translate each LOYALTY_SCORE into a verdict, bucketing operatives into categories the station chiefs can act on. It is the same expression working analysts use every day to turn raw numbers into labels.
Type the query, watch the rows come back, and let the server judge whether your classification holds.
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 CODENAME,
CASE WHEN LOYALTY_SCORE >= 90 THEN 'TRUSTED'
ELSE 'REVIEW'
END AS VERDICT
FROM OPERATIVES;Related guides
Free guides that pair well with this chapter:
Play Exchange 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.