Unlock the power of your data in the cloud! Get hands-on with Google Cloud's core data services like BigQuery and Looker to validate your practical skills in data ingestion, analysis, and management, and earn your Associate Data Practitioner certification!
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
A data analyst needs to prepare a summary report in BigQuery that combines customer information with sales transactions. The database contains two tables:
customers (columns: customer_id, customer_name)orders (columns: order_id, customer_id, order_amount)The analyst must produce a structured dataset showing each customer's name, the total number of orders placed, and their total spending across all transactions.
Which SQL query should the analyst execute in BigQuery to generate this report?
This query combines tabular data from two distinct tables using a JOIN clause and applies aggregate functions (COUNT and SUM) grouped by a categorical attribute (customer_name) using a GROUP BY clause.
JOIN with the predicate ON c.customer_id = o.customer_id correctly merges the customers table with the orders table using their common key (customer_id).COUNT(o.order_id) aggregate function tallies the total number of order records associated with each individual customer.SUM(o.order_amount) aggregate function calculates the mathematical total of numeric order values for each customer.GROUP BY c.customer_name clause establishes the grouping boundary, ensuring that aggregation functions reduce multiple transaction rows down to a single summary row per customer.customer_name) as a dimension and numeric quantities (order_id counts, order_amount sums) as metrics.Executing transformations and aggregations directly in the underlying database ensures that downstream reports receive precise, pre-summarized data, minimizing processing overhead and avoiding query errors.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.