CODE WORKSPACE

Interview incremental action plan

Return customer_id and load_action after deduping staged customer rows and comparing to the current dimension.

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

Sample input

customer_stage vs dim_customer_currentDedupe staged rows, ignore null keys, then compare source to target.
customer_idstage_tiertarget_tieris_deleted
101goldsilver0
103bronzebronze1
104platinumgold0
105bronzebronze0

Expected output

Expected outputUse delete, not delete_candidate, because this capstone asks for final action labels.
customer_idload_action
101update
102insert
103delete
104update
105unchanged
106insert

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.