AWS Certified Data Engineer – Associate (DEA-C01) — Question 203
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 to remove customers that exist in a table named monthly_accounts_update table from the customer accounts table:
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?
Answer options
- 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.
Correct answer: A
Explanation
When the data engineer runs the SQL command, all customer records that match between the accounts table and the monthly_accounts_update table will be deleted as specified by the WHEN MATCHED clause. Options B, C, and D are incorrect because they misinterpret the command's intent, with B suggesting records will be retained instead of deleted, C incorrectly stating that the source table will be deleted, and D claiming the syntax is invalid when it is actually valid.