nerdexam
Databricks

DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE · Question #78

In which of the following scenarios should a data engineer use the MERGE INTO command instead of the INSERT INTO command?

The correct answer is D. When the target table cannot contain duplicate records. MERGE INTO (also called upsert) checks each incoming source row against existing rows in the target table based on a match condition. If a match is found, it can UPDATE the existing row; if no match is found, it INSERTs a new row. This prevents duplicates. INSERT INTO blindly…

Submitted by khalil_dz· Apr 18, 2026ELT with Spark SQL and Python

Question

In which of the following scenarios should a data engineer use the MERGE INTO command instead of the INSERT INTO command?

Options

  • AWhen the location of the data needs to be changed
  • BWhen the target table is an external table
  • CWhen the source table can be deleted
  • DWhen the target table cannot contain duplicate records
  • EWhen the source is not a Delta table

How the community answered

(26 responses)
  • D
    96% (25)
  • E
    4% (1)

Explanation

MERGE INTO (also called upsert) checks each incoming source row against existing rows in the target table based on a match condition. If a match is found, it can UPDATE the existing row; if no match is found, it INSERTs a new row. This prevents duplicates. INSERT INTO blindly appends all rows without checking for pre-existing records. When data integrity requires uniqueness (no duplicate records), MERGE INTO is the correct choice. The other options - table location, external vs. internal, deletability of source, or source format - are not determining factors for choosing MERGE INTO.

Topics

#MERGE INTO#INSERT INTO#Delta Lake#UPSERT

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE Practice