[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Machine Learning with SQL

📊 BigQuery ML & Data AI 10m 200 BASE XP⌨ HANDS-ON LAB

In-Database Machine Learning Without Data Movement

Extracting terabytes or petabytes of analytical data from cloud data warehouses into external Python environments creates security risks, network bottlenecks, and compute redundancy. BigQuery ML (BQML) solves this by training, evaluating, and serving machine learning models directly inside Google BigQuery using standard SQL.

Supported BQML Model Topologies
  • Classification & Regression: Logistic regression, linear regression, and XGBoost gradient boosted trees.
  • Time Series: ARIMA_PLUS with automated hyperparameter tuning, holiday effect adjustments, and anomaly detection.
  • Deep Learning: TensorFlow and PyTorch model importing for in-database hardware acceleration.
-- 1. Train an enterprise customer churn prediction model in SQL
CREATE OR REPLACE MODEL `retail_dw.customer_churn_model`
OPTIONS(
  model_type='BOOSTED_TREE_CLASSIFIER',
  input_label_cols=['has_churned'],
  max_iterations=50,
  learn_rate=0.1
) AS
SELECT
  account_age_months,
  monthly_spend_gbp,
  support_tickets_30d,
  has_churned
FROM `retail_dw.customer_features`;

-- 2. Evaluate model performance metrics (ROC-AUC, Precision, Recall)
SELECT * FROM ML.EVALUATE(MODEL `retail_dw.customer_churn_model`);
⌨ HANDS-ON LABGenerate Text in BigQuery Using ML.GENERATE_TEXT
⭐ +150 XP

Execute an in-database BigQuery ML inference SQL query that calls a remote Gemini model on a customer sentiment table.

1Run an ML.GENERATE_TEXT query against the BigQuery remote model.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 2
What is the primary advantage of BigQuery ML?
It uses a proprietary Python library
It allows you to train models directly inside the data warehouse using SQL, avoiding data movement
It creates relational databases automatically
It is exclusively for image classification