Review live direct grants never exercised in the request log
Original fictional practice · CC BY 4.0 · 2026-11-11

TASK
At day10, return grant_id,principal,resource for direct user allow grants expiring>10 with no same-user/resource request anywhere in the log. Known users are alice,bob,outsider; exclude group/public grants. Sort grant_id.

OUTPUT
grant_id, principal, resource

RULES
At day10, return grant_id,principal,resource for direct user allow grants expiring>10 with no same-user/resource request anywhere in the log. Known users are alice,bob,outsider; exclude group/public grants. Sort grant_id.
Return exactly the declared columns and order. Money uses integer cents; time and date units follow the task and field dictionary. NULL is unknown and differs from numeric zero.
These are original fictional records and exercise policies. Scenario data may be shared with related tasks, whose decisions and output contracts differ.

FIELD DICTIONARY
grants:
  id INTEGER — Stable source record identifier; not a row position.
  principal TEXT — Literal business key or category label. Match exactly and retain NULL where present.
  resource TEXT — Literal business key or category label. Match exactly and retain NULL where present.
  effect TEXT — Permission outcome, allow or deny.
  expires INTEGER — Expiry boundary; the goal declares whether equality is eligible.
  mask INTEGER — Privacy mask level; higher values require stricter masking.

members:
  member TEXT — Literal business key or category label. Match exactly and retain NULL where present.
  parent TEXT — Immediate parent identifier, or NULL for a hierarchy root.

requests:
  id INTEGER — Stable source record identifier; not a row position.
  user TEXT — Literal business key or category label. Match exactly and retain NULL where present.
  resource TEXT — Literal business key or category label. Match exactly and retain NULL where present.
  day INTEGER — Integer day index, or ISO YYYY-MM-DD date when stored as text; the task declares cutoff semantics.

approvals:
  id INTEGER — Stable source record identifier; not a row position.
  requester TEXT — Literal business key or category label. Match exactly and retain NULL where present.
  approver TEXT — Literal business key or category label. Match exactly and retain NULL where present.
  resource TEXT — Literal business key or category label. Match exactly and retain NULL where present.

METHOD
At day10, return grant_id,principal,resource for direct user allow grants expiring>10 with no same-user/resource request anywhere in the log. Known users are alice,bob,outsider; exclude group/public grants. Sort grant_id.
For the first output record, grant_id = 10; principal = alice; resource = archive.
Inspect the source grain, keys and ties. Compare each result column with the full worked SQL and expected CSV.

COMMON WRONG TURN
Treating group grants as direct-user grants misstates whether a particular credential is unused.

RESULT CHECK
For the first output record, grant_id = 10; principal = alice; resource = archive.

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.
