Open lesson

Mission: find the missing night without draining the budget

Command palette

This mission workspace keeps code and notes in this browser tab. Export them before closing it. Running code is practice, not an automatic grade for the mission.

Brief

Reduce and estimate the data scanned by a warehouse query using a partition filter, a dry run, and a limit.

Mara gets a message from Voss: 'Query the whole table and publish the number now.' Imani first wants the two nights around the crash and the preserved source files. Propose a narrow query, explain its imaginary data volume, and refuse to treat a row count as final proof. The meeting is urgent in the story; the exercise has no timer.

Your mission

  1. Explain why originals are kept as files while counts use a table copy.
  2. Name the column and two-date range the query filters.
  3. Calculate volumes for two days and 30 days, then compare them.
  4. Explain a dry run, a 5 GB limit, and why LIMIT 10 cannot replace the filter.

How to check your work

  • Object storage for files; warehouse for table analysis.
  • event_date from April 12 through 13, 2026.
  • 4 GB versus 60 GB; the month scans 15 times as much in this model.
  • Dry run estimates; a limit can reject a broad query; LIMIT alone does not prune partitions.

Course example

This version runs in the workspace's SQLite database. The warehouse syntax shown in the lesson needs its own tool.

SELECT event_date, COUNT(*) AS observations
FROM telemetry_events
WHERE event_date BETWEEN '2026-04-12' AND '2026-04-13'
GROUP BY event_date
ORDER BY event_date;

SQLite schema and synthetic input

CREATE TABLE telemetry_events (event_date TEXT NOT NULL, event_id TEXT PRIMARY KEY);
INSERT INTO telemetry_events VALUES ('2026-04-12', 'E1'), ('2026-04-12', 'E2'), ('2026-04-13', 'E3');

Code

Use Tab to leave the editor. Ctrl+Enter runs the source. The lines beginning with -- are task reminders. SQL ignores them. Write your query beneath them.

SQL console

Loading laboratory…

Explore Python or SQL here; this is not an operating-system shell.

This is a disposable browser experiment. The code run here is not recorded as a completed mission.

Each command starts a fresh disposable worker: it runs a captured copy of your current source, then your command with the lesson fixtures. Changes are discarded afterward. Commands never save source or award XP. Ctrl+Enter executes the command.

Virtual workspace files

Source and declarative assets are readable here without JavaScript. Python input files are created at runtime; SQL setup initializes the disposable database.

source.sql

Current editor source. Inspection shows your current edits.

-- Explain why originals are kept as files while counts use a table copy.
-- Name the column and two-date range the query filters.
-- Calculate volumes for two days and 30 days, then compare them.
-- Explain a dry run, a 5 GB limit, and why LIMIT 10 cannot replace the filter.

exemple.sql

Declarative lesson asset; this is not a file created in the Python filesystem.

SELECT event_date, COUNT(*) AS observations
FROM telemetry_events
WHERE event_date BETWEEN '2026-04-12' AND '2026-04-13'
GROUP BY event_date
ORDER BY event_date;
donnees.sql

Declarative lesson asset; this is not a file created in the Python filesystem.

CREATE TABLE telemetry_events (event_date TEXT NOT NULL, event_id TEXT PRIMARY KEY);
INSERT INTO telemetry_events VALUES ('2026-04-12', 'E1'), ('2026-04-12', 'E2'), ('2026-04-13', 'E3');