Skip to content
Astera Technology

Why does an unknown estimate lead a smallest-effort list?

Place unknowns after known estimates without converting them to zero.

Download complete case notes and answer keys ↓

Prepare the report input

Original presentation lists known estimates ascending, then unknowns, with id as tie order. SQLite ASC normally places NULL first. NULLS LAST implements the supplied display policy while preserving NULL. No work is assigned by this report.

Every record and report rule below is original and fictional. Reproduce the setup in a fresh SQLite test database; input previews include every table in this small fixture.

Synthetic input: estimates
idhours
ANULL (unknown or absent)
B2
C5
Download editable CSV ↓
Complete CREATE and INSERT fixture
CREATE TABLE estimates(id TEXT PRIMARY KEY,hours INTEGER); INSERT INTO estimates VALUES('A',NULL),('B',2),('C',5);

Compare misleading and corrected results

Misleading SELECT: reproduce the defect
SELECT id,hours FROM estimates ORDER BY hours,id;
Literal misleading result
idhours
ANULL (unknown or absent)
B2
C5
Download editable CSV ↓
Corrected SELECT
SELECT id,hours FROM estimates ORDER BY hours NULLS LAST,id;
Literal corrected result
idhours
B2
C5
ANULL (unknown or absent)
Download editable CSV ↓

Bad list starts unknown A; corrected list is B=2,C=5,A unknown. Unknown is not an observed zero-hour estimate.

Check a fresh boundary case

Make every estimate NULL. The output remains an all-unknown list ordered by id, not a claimed smallest known job.

Recreate the original setup in another fresh database, then apply the change and corrected query below. For an empty result, the table displays a labelled empty-result marker rather than a data record.

Boundary change and corrected query
UPDATE estimates SET hours=NULL;
SELECT id,hours FROM estimates ORDER BY hours NULLS LAST,id;
Literal boundary result
idhours
ANULL (unknown or absent)
BNULL (unknown or absent)
CNULL (unknown or absent)
Download editable CSV ↓

Does the all-NULL boundary prove A takes least effort?

Show the worked answer

No. A is first only by the id tie rule; every effort value remains unknown.

Related resources