
Answer-first summary for fast verification
Answer: Select * from Employee where Region ID='North America' and Department ID=20;, Select * from Employee where Region ID='North America' and Role ID=50;
Option B is CORRECT because querying the Employee table with a filter on Region ID and Department ID takes advantage of the compound sort key. In a compound sort key, the columns are sorted in the order they are defined. Queries that filter on Region ID and Department ID can efficiently utilize the sorted structure to speed up data retrieval, as the sort key helps narrow down the data that needs to be scanned. Option E is CORRECT because filtering on Region ID and Role ID also takes advantage of the Region ID being the first part of the compound sort key. While Role ID is not next in the sort order after Region ID, the query can still benefit from the initial sort on Region ID, reducing the amount of data that needs to be scanned.
Author: Ritesh Yadav
Ultimate access to all questions.
Question 19/58
A company stores employee data in Amazon Redshift. A table named 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.)
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;
No comments yet.