This check asks you to mark the TRUE rows before comparing with the recomputed SQL output.

highlighted = computed this step

Input table

Start by reading each order row without changing the table.

exercise input\text{exercise input}
Ordersorder_idstatusamounto1paid120o2pending40o3paid70o4review95

Where query

Apply the two predicates together: status is paid, and amount is above the threshold.

paid AND amount above threshold\text{paid AND amount above threshold}
WHERE paid and amount greater than 80where andarity 3 rows 1Ordersarity 3 rows 4

Predicate truth

Only rows where both predicates are TRUE pass the combined filter.

by-hand TRUE row check\text{by-hand TRUE row check}
Three-valued truthrowtruth1TRUE2FALSE3FALSE4FALSE

Filtered output

The recomputed output is the answer key for the exercise.

checked output\text{checked output}
Filtered outputorder_idstatusamounto1paid120