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

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.