Specify ordering, frame and the actual constraint before predicting.
Review ROW_NUMBER, ranking ties, running totals, a filtered CTE and two explicit INSERT constraint failures.
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.
Four result sets and two rejected statements
The first four tasks calculate window numbers, a rank pair, a running sum or a count from a named filtered input. Their data and orderings are fully supplied. The final two tasks ask about an INSERT against a UNIQUE or NOT NULL declaration. Those are statement outcomes, not extra SELECT rows. Identify which kind of question you are answering before reading a numeric option or assuming that a rejected write produces a normal result set.
UNIQUE does not imply NOT NULL in this SQLite example
In a new unscored SQLite example, create codes(code TEXT UNIQUE), insert NULL twice and select COUNT(*). Both inserts succeed and the count is two: SQLite treats the two NULLs as distinct for this UNIQUE constraint. Adding NOT NULL would change the declaration and outcome. This deliberately contrasts a repeated non-NULL unique value with missing values, rather than claiming that every database engine or every constraint form treats NULL identically.
Separate a window’s order from final row order
ROW_NUMBER assigns consecutive positions using its window ORDER BY. The bank includes id as a deterministic tie-breaker for that task. A final ORDER BY controls how the result rows are returned and is a separate clause. RANK and DENSE_RANK use score alone in the other task, intentionally retaining peers; one leaves gaps after tied rows and the other does not. Do not add a tie-breaker to that window, because it would change the peer groups.
Read the frame and the stage of filtering
The running total explicitly uses ROWS from the beginning through the current row, ordered by a unique id. That supplies its accumulation rule rather than relying on an unstated default. In the ranking CTE, all rows are ranked before the outer id filter selects one. In the separate filtered CTE, qualifying rows are selected before the outer count. Follow the actual clauses instead of assuming that every WHERE appears at the same logical stage.
Use the exact declared column restriction
The repeated ordinary string violates the bank’s UNIQUE declaration. The database NULL violates the separate NOT NULL declaration. Neither final INSERT asks for OR REPLACE, OR IGNORE or an alternative conflict policy, so those behaviours must not be silently substituted. A failed statement is not a certificate that an application manages transactions correctly. The provided questions do not ask you to infer every earlier statement’s rollback state or concurrent-session visibility.
Predict a tie or one changed declaration
In a disposable in-memory database, invent three ranked values with a tie. Write the expected window positions and the final display order separately before running. Then use a separate tiny table to compare one UNIQUE declaration with one that also disallows NULL. Change just the declared condition or one value at a time. No production data or credentials are needed, and the website does not execute SQL submitted by visitors or modify a connected database.
Keep practice separate from a database qualification
The section counts six matching outcomes on a fixed original bank verified with SQLite 3.53.4. It does not establish expertise in concurrency, schema design, query tuning or production incident response. Every answer explanation and full guide remains free at zero, partial and perfect counts. There are no professional bands, hiring cutoffs or vendor qualifications. After reading the worked keys, use new inputs rather than treating an improved repeat count as proof of transfer.