Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon-DEA-C01 Exam - Topic 2 Question 30 Discussion

A data engineer is using an AWS Glue ETL job to remove outdated customer records from a table that contains customer account information. The data engineer is using the following SQL command:MERGE INTO accounts t USING monthly_accounts_update sON t.customer = s.customerWHEN MATCHED THEN DELETEWhat will happen when the data engineer runs the SQL command?
A) All customer records that exist in both the customer accounts table and the monthly_accounts_update table will be deleted from the accounts table.
B) Only customer records that are present in both tables will be retained in the customer accounts table.
C) The monthly_accounts_update table will be deleted.
D) No records will be deleted because the command syntax is not valid in AWS Glue.

Amazon-DEA-C01 Exam - Topic 2 Question 30 Discussion

Actual exam question for Amazon's Amazon-DEA-C01 exam
Question #: 30
Topic #: 2
[All Amazon-DEA-C01 Questions]

A data engineer is using an AWS Glue ETL job to remove outdated customer records from a table that contains customer account information. The data engineer is using the following SQL command:

MERGE INTO accounts t USING monthly_accounts_update s

ON t.customer = s.customer

WHEN MATCHED THEN DELETE

What will happen when the data engineer runs the SQL command?

Show Suggested Answer Hide Answer
Suggested Answer: A

In AWS Glue's SQL implementation (Spark SQL-compatible), the MERGE INTO statement supports conditional actions.

The clause WHEN MATCHED THEN DELETE deletes matching records from the target table (accounts) where the join condition is true.

''A MERGE INTO statement can perform updates, inserts, or deletes based on the match condition between source and target tables.''

-- Ace the AWS Certified Data Engineer - Associate Certification - version 2 - apple.pdf


Contribute your Thoughts:

0/2000 characters
Golda
2 days ago
If I recall correctly, the MERGE command is used for updating and deleting records, so option A makes sense to me.
upvoted 0 times
...
Keith
7 days ago
I remember practicing a similar question, but I’m not entirely sure if the syntax is valid in AWS Glue. Could it be option D?
upvoted 0 times
...
Ricarda
12 days ago
I think the command will delete all matching records from the accounts table, so I’m leaning towards option A.
upvoted 0 times
...

Save Cancel