nerdexam
Databricks

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

A data engineering team has two tables. The first table march_transactions is a collection of all retail transactions in the month of March. The second table april_transactions is a collection of…

The correct answer is B. CREATE TABLE all_transactions AS. The question states there are no duplicate records between the two tables, but the goal is to produce a result 'without duplicate records.' The key distinction is between UNION and UNION ALL. UNION combines results and removes any duplicate rows across the combined result set…

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

Question

A data engineering team has two tables. The first table march_transactions is a collection of all retail transactions in the month of March. The second table april_transactions is a collection of all retail transactions in the month of April. There are no duplicate records between the tables. Which of the following commands should be run to create a new table all_transactions that contains all records from march_transactions and april_transactions without duplicate records?

Options

  • ACREATE TABLE all_transactions AS
  • BCREATE TABLE all_transactions AS
  • CCREATE TABLE all_transactions AS
  • DCREATE TABLE all_transactions AS
  • ECREATE TABLE all_transactions AS

How the community answered

(56 responses)
  • A
    11% (6)
  • B
    82% (46)
  • C
    2% (1)
  • D
    5% (3)

Explanation

The question states there are no duplicate records between the two tables, but the goal is to produce a result 'without duplicate records.' The key distinction is between UNION and UNION ALL. UNION combines results and removes any duplicate rows across the combined result set, while UNION ALL keeps all rows including duplicates. Answer B uses UNION (without ALL), which correctly deduplicates the combined output. Even though the tables have no inter-table duplicates, using UNION ensures correctness and is the semantically appropriate choice when deduplication is explicitly required.

Topics

#SQL#Data Transformation#UNION Operator#CREATE TABLE AS SELECT (CTAS)

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE Practice