Google Cloud Associate Data Practitioner — Question 81
Your organization is conducting analysis on regional sales metrics. Data from each regional sales team is stored as separate tables in BigQuery and updated monthly. You need to create a solution that identifies the top three regions with the highest monthly sales for the next three months. You want the solution to automatically provide up-to-date results. What should you do?
Answer options
- A. Create a BigQuery table that performs a UNION across all of the regional sales tables. Use the ROW_NUMBER() window function to query the new table.
- B. Create a BigQuery table that performs a CROSS JOIN across all of the regional sales tables. Use the RANK( ) window function to query the new table.
- C. Create a BigQuery materialized view that performs a UNION across all of the regional sales tables. Use the RANK() window function to query the new materialized view.
- D. Create a BigQuery materialized view that performs a CROSS JOIN across all of the regional sales tables. Use the ROW_NUMBER() window function to query the new materialized view.
Correct answer: C
Explanation
The correct answer is C because a materialized view will allow you to automatically refresh the data and the RANK() function will effectively identify the top regions based on sales. Options A and B do not utilize a materialized view, which is essential for automation, and Option D uses ROW_NUMBER() instead of RANK(), which does not adequately rank the regions for the desired outcome.