Sign in to run and submit your work
Reading is open to everyone. Running code and saving drafts need an account so your work is yours and comes back on your next visit.
or
CODE WORKSPACE
Return exactly customer_id and audit_status across the union of current-dimension keys and clean staged keys.
Result columns · in this order
customer_idaudit_statusHow to approach it
Build all_keys from current and staged keys, then left join each side and classify.
Sample input
| customer_id | source_tier | target_tier | source_deleted |
|---|---|---|---|
| 101 | gold | silver | 0 |
| 102 | silver | null | 0 |
| 103 | bronze | bronze | 1 |
| 104 | platinum | gold | 0 |
| 105 | bronze | bronze | 0 |
| 106 | silver | null | 0 |
| 107 | null | silver | null |
7 rows — all rows shown.
Expected output
| customer_id | audit_status |
|---|---|
| 101 | attribute_drift |
| 102 | missing_current |
| 103 | source_delete |
| 104 | attribute_drift |
| 105 | aligned |
| 106 | missing_current |
| 107 | missing_source |
7 rows — all rows shown.
Constraints
Dedupe customer_stage before comparison. Use statuses missing_current, missing_source, source_delete, attribute_drift, and aligned. Order by customer_id.
Expected skills
Current-state snapshot auditing and source/target drift labels.
Submit for review to find out what your query gets right, what it gets wrong, and how it compares with the best working query for this exercise.
This scenario runs a full workspace — editor, canvas and results side by side. It needs a laptop or desktop to be usable. Open this page on a bigger screen to start building.