Identify baskets qualifying for a cross-category bundle Original fictional practice · CC BY 4.0 · 2026-11-11 TASK A basket qualifies when it has at least two book units and at least one tool unit. Return order_id,book_units,tool_units for qualifiers sorted order_id. OUTPUT order_id, book_units, tool_units RULES A basket qualifies when it has at least two book units and at least one tool unit. Return order_id,book_units,tool_units for qualifiers sorted order_id. Return exactly the declared columns and order. Money uses integer cents; all time values are elapsed UTC minutes unless a field is explicitly a day index. NULL is unknown and differs from numeric zero. These are original fictional records and exercise policies. All source tables in this case are included in the downloadable pack. FIELD DICTIONARY basket: order_id INTEGER — Stable record or business key; retain its declared type. sku TEXT — Literal text label or key; comparisons use SQLite binary text semantics. qty INTEGER — Exact integer measurement; use the task rule for units and ordering. price INTEGER — Exact integer measurement; use the task rule for units and ordering. category TEXT — Literal text label or key; comparisons use SQLite binary text semantics. required: sku TEXT — Literal text label or key; comparisons use SQLite binary text semantics. METHOD A basket qualifies when it has at least two book units and at least one tool unit. Return order_id,book_units,tool_units for qualifiers sorted order_id. Inspect the source grain, keys and ties before writing the query. Use the worked SQL and complete expected CSV to review any mismatch. COMMON WRONG TURN Counting lines instead of quantity misses bundles with multiple units on a single line. RESULT CHECK The independent JavaScript solver and actual SQLite reference must agree on every output cell. Use setup.sql in a fresh SQLite database and run your own SELECT or WITH. reference.sql and expected.csv contain the full worked answer. All CSVs have UTF-8 headers; empty output fields represent NULL. The browser executes SQLite, not Excel formulas. No spreadsheet function engine is claimed.