Noos
PT EN
RAN-DBDEA-00234
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: hard

Every night, a MERGE synchronizes catalog.sales.silver_orders with the source extract, updating matched orders and inserting new ones: ```sql MERGE INTO catalog.sales.silver_orders AS t USING catalog.sales.source_orders AS s ON t.order_id = s.order_id WHEN MATCHED THEN UPDATE SET * WHEN NOT MATCHED THEN INSERT * ``` Orders are sometimes deleted in the source, and those deletions must also disappear from silver_orders, in the same atomic statement. Which clause adds this behavior?

Options (Reading Mode) Click to filter discussion →
  1. A. WHEN NOT MATCHED BY SOURCE THEN DELETE — it applies to the target rows whose keys have no counterpart in the source table
  2. B. WHEN NOT MATCHED THEN DELETE — that clause already covers the target rows that are absent from the source
  3. C. None: every MERGE clause can only act on rows of the source, so unmatched target rows are out of the statement's reach
  4. D. Deletion is outside MERGE's scope, so schedule a separate DELETE ... WHERE order_id NOT IN (SELECT ...) after every merge runs
Reveal answer

Correct answer: WHEN NOT MATCHED BY SOURCE THEN DELETE — it applies to the target rows whose keys have no counterpart in the source table

Reference: https://docs.databricks.com/aws/en/delta/merge

02 — The Myelin Layer · Canonical Discussion

Where the exam tries to trick you — and how those who passed solved it.

0 Passed

contributed to this question

Answer Distractor Matrix Click an option to filter or open its dissection.
✦ Consolidated Synthesis (Wiki) rev. #1 (baseline) · CC BY-SA 4.0
Start synthesis for this question →

No community synthesis consolidated for this question yet. Below is the verifiable official starting point — if you passed the exam, open the option dissection.

Official Answer (A): WHEN NOT MATCHED BY SOURCE THEN DELETE — it applies to the target rows whose keys have no counterpart in the source table

⚓ Official Documentation Anchor: https://docs.databricks.com/aws/en/delta/merge
Ranvier · DBDEA

Contribute to this Question

Your contribution builds your Orbital Sheath

Peer contributions

No public contribution yet. Be the first who passed to explain why the distractors trick candidates — your contribution builds your Orbital Sheath.