GCP Professional Data Engineer Practice Question

Your retail analytics team created the following materialized view to speed up regional sales dashboards:

CREATE MATERIALIZED VIEW analytics.mv_sales_by_region
AS
SELECT
  region,
  SUM(sales_amount) AS total_sales
FROM analytics.fact_sales
GROUP BY region;

Business-intelligence tools continue to run SQL directly against the base table analytics.fact_sales. Which of the following ad-hoc queries can BigQuery's optimizer transparently rewrite to read only from analytics.mv_sales_by_region, avoiding a full scan of fact_sales without you changing any dashboard code?

  • SELECT region, SUM(sales_amount) FROM analytics.fact_sales WHERE order_channel = 'ONLINE' GROUP BY region;

  • SELECT region, AVG(sales_amount) AS avg_sales FROM analytics.fact_sales GROUP BY region;

  • SELECT region, SUM(sales_amount) FROM analytics.fact_sales GROUP BY region;

  • SELECT region, COUNT(*) AS order_count, SUM(sales_amount) FROM analytics.fact_sales GROUP BY region;

GCP Professional Data Engineer
Preparing and using data for analysis
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot