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…
Question
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)- A11% (6)
- B82% (46)
- C2% (1)
- D5% (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
Community Discussion
No community discussion yet for this question.