Question 3: You are working in an ecommerce company which had created a table in Redshift cluster to store the data for all the order placed on the website. On the daily basis you have to add new data in the same

table which can be an update for older orders and also have new order data. Which of the following is best strategy for merging new data in the existing table?

1. You will be writing a SQL merge statement.

2. You will be using single merge command, using AWS CLI tool.

3. You will be using Staging tables for merging the new data.

4. 1 and 3

5. 2 and 3

Correct Answer : 3 Exp : You can efficiently add new data to an existing table by using a combination of updates and inserts from a staging table. While Amazon Redshift does not support a single merge, or upsert,

command to update a table from a single data source, you can perform a merge operation by creating a staging table.

You should run the entire merge operation, except for creating and dropping the temporary staging table, in a single transaction so that the transaction will roll back if any step fails. Using a single transaction

also reduces the number of commits, which saves time and resources.

3