CODE WORKSPACE

Classify incremental load actions

Compare staged customer rows to the current dimension and classify insert, update, unchanged, and delete candidates.

The SQL API will hydrate this workspace with the exercise-specific starter query and schema.

Sample input

customer_stageIncoming batch. Customer 104 appears twice, customer 105 is unchanged, customer 103 is a tombstone, and the NULL key is ignored.
customer_idemailtieris_deletedupdated_atbatch_id
101ana@example.comgold02026-03-05 10:00:007001
102ben@example.comsilver02026-03-05 11:00:007001
103cy@example.combronze12026-03-05 12:00:007001
104dee-old@example.comgold02026-03-05 09:00:007000
104dee@example.complatinum02026-03-05 12:30:007001
105eli@example.combronze02026-03-05 08:00:007001
106fay@example.comsilver02026-03-04 23:30:006999
dim_customer_currentCurrent target table before the batch is applied.
customer_idemailtieris_active
101ana@example.comsilver1
103cy@example.combronze1
104dee@example.comgold1
105eli@example.combronze1
107gus@example.comsilver1

Expected output

Expected outputOne row per clean staged customer. 101/104 update, 102/106 insert, 103 is a delete candidate, and 105 is unchanged.
customer_idload_action
101update
102insert
103delete_candidate
104update
105unchanged
106insert

Constraints

Load the live SQL exercise to inspect the full prompt, schema, starter query, and expected output.

Expected skills

Incremental loads, CASE, MERGE prep

SQL
Loading...

AI evaluation

Run the SQL query to inspect preview rows.