Certified Data Engineer Associate Exam QuestionsBrowse all questions from this exam

Certified Data Engineer Associate Exam - Question 21


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?

Show Answer
Correct Answer: B

To create a new table all_transactions that contains all records from march_transactions and april_transactions without duplicate records, the UNION operator should be used. The UNION operator combines the result sets of the two tables while automatically removing duplicate records. Therefore, the correct command is: CREATE TABLE all_transactions AS SELECT * FROM march_transactions UNION SELECT * FROM april_transactions.

Discussion

8 comments
Sign in to comment
ezeikOption: B
Sep 18, 2023

UNION [ALL | DISTINCT] Returns the result of subquery1 plus the rows of subquery2`. If ALL is specified duplicate rows are preserved. If DISTINCT is specified the result does not contain any duplicate rows. This is the default. https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-qry-select-setops.html#examples

XiltroXOption: B
Apr 1, 2023

Answer is correct

SerGreyOption: B
Jan 4, 2024

B is correct

surrabhi_4Option: B
Apr 4, 2023

option B

prasiosoOption: B
May 13, 2023

Answer is B.

AtnafuOption: B
Jul 8, 2023

B CREATE TABLE all_transactions AS SELECT * FROM march_transactions UNION SELECT * FROM april_transactions;

vctrhugoOption: B
Sep 3, 2023

B. CREATE TABLE all_transactions AS SELECT * FROM march_transactions UNION SELECT * FROM april_transactions; To create a new table all_transactions that contains all records from march_transactions and april_transactions without duplicate records, you should use the UNION operator, as shown in option B. This operator combines the result sets of the two tables while automatically removing duplicate records.

awofalusOption: B
Nov 7, 2023

Correct: B