Databricks Certified Data Engineer - Associate

Databricks Certified Data Engineer - Associate

Get started today

Ultimate access to all questions.


A data engineer is tasked with identifying records that are common between two Delta tables with identical schemas. Which SQL command should she use to find these overlapping records?





Explanation:

To understand the correct answer, let's break down the options:

  • UNION ALL – Retrieves all rows, including duplicates, from both queries.
  • UNION – Retrieves distinct records from both queries, removing duplicates.
  • MINUS or EXCEPT – Retrieves rows from the first SELECT statement not found in the second SELECT statement.
  • INTERSECT – Retrieves only the rows common to both SELECT statements.
  • COPY INTO – Offers an idempotent method for incrementally ingesting data from external systems, with expectations like consistent data schema and handling of duplicate records downstream.

The correct command to find common records is INTERSECT.