CODE WORKSPACE

Build merge source delta

Return only staged rows that should affect the target, excluding unchanged records.

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

Sample input

clean staged rows + current targetAfter dedupe, compare each staged key to the current target and keep only rows that would change the target.
customer_idstage_tiertarget_tieris_deleted
101goldsilver0
102silvernull0
103bronzebronze1
104platinumgold0
105bronzebronze0
106silvernull0

Expected output

Expected outputCustomer 105 is unchanged and is intentionally excluded from the merge delta.
customer_idemailtieris_deletedload_action
101ana@example.comgold0update
102ben@example.comsilver0insert
103cy@example.combronze1delete_candidate
104dee@example.complatinum0update
106fay@example.comsilver0insert

Constraints

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

Expected skills

Delta logic, MERGE, CTEs

SQL
Loading...

AI evaluation

Run the SQL query to inspect preview rows.