CODE WORKSPACE

Interview audit union capstone

Return one pass/fail audit evidence table with named quality checks.

Start by naming the output grain, then build CTEs that can be inspected one at a time.

Sample input

audit checksEach named check should return a count and pass/fail status.
check_nameexample_failing_rows
duplicate_snapshot_keys2
missing_country_customers1
orders_without_items5
line_item_total_mismatches4

Expected output

Expected outputEvery check returns evidence even when it passes; this dataset has four failing checks.
check_namefailing_rowsstatus
duplicate_snapshot_keys2fail
line_item_total_mismatches4fail
missing_country_customers1fail
orders_without_items5fail

Constraints

State the output contract first, use readable CTE layers, return the exact columns requested by the prompt, and use deterministic ordering.

Expected skills

Interview clarification, SQL structure, edge-case handling, and final-answer narration.

SQL
Loading...

AI evaluation

Run the SQL query to inspect preview rows.