Brief
Select and order useful table rows while treating missing times as unknown, never as zero or an invented hour.
In the story, Voss shows only two NOCTIS-01 passages and claims the car was at South when the crash happened. Mara notices P4, a South row without a time. Imani gives you fictional rows: P1 Noctis North 21:10, P2 Test-02 South 21:20, P3 Noctis South 21:25, P4 Noctis South NULL, P5 Test-03 North 21:40, P6 Noctis South 21:35. You have a few fictional minutes to prepare a checkable answer.
Your mission
- Write a filter retaining Noctis rows at North or South, with clear parentheses.
- Write a query showing the first two Noctis rows with known times, then name their IDs.
- Write a query finding rows without times and name the matching row.
- Explain why P4 must neither be placed at 00:00 nor removed from the investigation.
How to check your work
- The filter connects Noctis to
(gate = 'North' OR gate = 'South'). - Ascending order and
LIMIT 2give P1 then P3 among known times. time IS NULLfinds P4.- P4 stays as a row to verify; its time position remains unknown.
Course example
SELECT id, vehicle, gate, time FROM passages WHERE vehicle = 'NOCTIS-01' AND time IS NOT NULL ORDER BY time ASC, id ASC LIMIT 2; SELECT id, vehicle, gate FROM passages WHERE time IS NULL;
SQLite schema and synthetic input
CREATE TABLE passages (id TEXT PRIMARY KEY, vehicle TEXT, gate TEXT, time TEXT);
INSERT INTO passages VALUES ('P1', 'NOCTIS-01', 'North', '21:10'), ('P2', 'TEST-02', 'South', '21:20'), ('P3', 'NOCTIS-01', 'South', '21:25'), ('P4', 'NOCTIS-01', 'South', NULL), ('P5', 'TEST-03', 'North', '21:40'), ('P6', 'NOCTIS-01', 'South', '21:35');