AWS Certified Data Engineer – Associate (DEA-C01) — Question 122
A company stores employee data in Amazon Resdshift. A table names Employee uses columns named Region ID, Department ID, and Role ID as a compound sort key.
Which queries will MOST increase the speed of query by using a compound sort key of the table? (Choose two.)
Answer options
- A. Select *from Employee where Region ID=’North America’;
- B. Select *from Employee where Region ID=’North America’ and Department ID=20;
- C. Select *from Employee where Department ID=20 and Region ID=’North America’;
- D. Select *from Employee where Role ID=50;
- E. Select *from Employee where Region ID=’North America’ and Role ID=50;
Correct answer: A, B
Explanation
The correct answers, A and B, utilize the compound sort key effectively by filtering on the primary sort key, Region ID, and the secondary sort key, Department ID, respectively. Options C, D, and E do not efficiently use the compound sort key, as they either ignore the primary key or do not combine the keys optimally for performance.