Ask which rows make the actual predicate true.
Review numeric and zone filters, IS NULL, equality with NULL, inclusive BETWEEN and a COALESCE fallback.
The section counts matching outcomes on six supplied SQLite 3.53.4 tasks. It is not a professional level, percentile, employer cutoff or qualification. Every explanation and all four full guides remain available regardless of count.
Start from the supplied four rows
The six filtering tasks repeat an explicit tiny table so that no row needs to be inferred. Each independent setup includes an integer quantity, a NULL quantity, a larger quantity and zero. The final statement asks for either ordered ids, a count or one replacement value. Evaluate that statement against those rows, keeping database NULL separate from the number zero and from the literal text used to display a missing result cell.
An OR can intentionally retain a NULL row
For a new unscored example, use a one-column sample containing zero, NULL and four. Count rows satisfying v=0 OR v IS NULL. The zero row satisfies the first part and the NULL row satisfies the second, so the count is two. The four row satisfies neither. This is a different predicate from v=NULL: explicitly testing for NULL can produce true and should not be replaced by ordinary equality.
Keep true distinct from false or NULL
WHERE retains a supplied row only when its predicate is true. A comparison involving a missing quantity does not become a match merely because another missing value appears on the other side of an equality sign. For each row, write the numeric or zone condition and its result before counting. In the bank’s OR item, a qualifying row is still counted once, even if more than one alternative could be true.
Use the stated boundaries and fallback argument
BETWEEN uses the included lower and upper bounds in this numeric task. COALESCE instead chooses the first non-NULL argument for the one row selected by id. It does not update the stored quantity, and the presence of zero elsewhere does not cause zero to be replaced. These are separate operations. Do not turn an inclusive interval into a strict interval or treat all falsy-looking numbers as SQL NULL.
An aggregate row can describe an empty input
The equality-with-NULL item retains no input rows, but COUNT(*) still returns one row containing zero. That differs from a nonaggregate SELECT returning no rows at all. Read what the final statement selects before choosing a representation. In this product, a vertical bar separates columns and a semicolon separates returned rows, with no heading row included; those display separators are not extra SQL values or additional data records.
Change one row and predict the retained ids
In a disposable in-memory database, invent a tiny input with one zero and one missing value. Write down which rows each predicate should retain, then execute the query after predicting. Change just one value or one comparison boundary and repeat. Keep the original and changed query conditions explicit. The website itself does not run visitor SQL or connect to a private database; these are optional revision steps in your own isolated example.
Use the explanation to locate a particular mistake
A six-item count cannot tell whether a mistake came from NULL handling, interval boundaries or the shape of an aggregate result. Read each full explanation before trying fresh data. These original outcomes were verified with SQLite 3.53.4, without claiming every SQL dialect or setting is identical. No professional band, employer threshold or certificate is assigned. Repeating the fixed bank after studying its keys can reflect remembered answers rather than unfamiliar-query reasoning.