Google Cloud Associate Data Practitioner — Question 49
Your team wants to create a monthly report to analyze inventory data that is updated daily. You need to aggregate the inventory counts by using only the most recent month of data, and save the results to be used in a Looker Studio dashboard. What should you do?
Answer options
- A. Create a materialized view in BigQuery that uses the SUM( ) function and the DATE_SUB( ) function.
- B. Create a saved query in the BigQuery console that uses the SUM( ) function and the DATE_SUB( ) function. Re-run the saved query every month, and save the results to a BigQuery table.
- C. Create a BigQuery table that uses the SUM( ) function and the _PARTITIONDATE filter.
- D. Create a BigQuery table that uses the SUM( ) function and the DATE_DIFF( ) function.
Correct answer: A
Explanation
The correct answer is A because creating a materialized view in BigQuery allows for efficient aggregation of the most recent month's data with the SUM() and DATE_SUB() functions. Option B requires manual re-execution of the saved query every month, which is less efficient. Options C and D do not correctly utilize the necessary functions to achieve the desired aggregation for the reporting needs.