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 at a retail company wants to build a machine learning model directly in BigQuery to predict the continuous numerical dollar amount (total_spend) that each customer will spend over the next quarter.
The training data resides in a BigQuery table named ecommerce.customer_features and contains columns for age, country, previous_purchases, and total_spend.
Which SQL statement correctly creates and trains this model?
Linear regression (model_type='linear_reg') is a supervised machine learning algorithm used to model the relationship between one or more independent input features and a continuous numerical target (label). In BigQuery ML, you train built-in models using standard SQL through the CREATE MODEL (or CREATE OR REPLACE MODEL) statement.
total_spend), which is a real-valued, continuous numerical metric. Setting model_type='linear_reg' creates a linear regression model optimized for continuous target variables.input_label_cols=['total_spend'] parameter explicitly tells BigQuery ML which column in the query output serves as the training label (target) that the model should learn to predict.AS SELECT ... query provides both the training features (age, country, previous_purchases) and the ground truth label (total_spend) directly from the table.CREATE OR REPLACE MODEL ... OPTIONS(...) AS SELECT structure native to BigQuery ML.CREATE MODEL clause: Defines the destination dataset and model name within BigQuery.OPTIONS() clause: Configures model hyperparameters, algorithm selection (model_type), and structural requirements such as input_label_cols.AS SELECT query: Defines the training dataset, including both input feature columns and target label column(s).country.This statement allows analysts to train and store machine learning models directly inside Google Cloud's data warehouse without extracting data to external environments or writing Python/R code. It accurately defines the correct model family and syntax required for continuous numerical forecasting.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.