Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Associate Data Practitioner practice bank has 1,132 more like it. Try 10 free: instant score, no account.
A data team is expanding their data warehouse capabilities by integrating external machine learning capabilities into BigQuery. They have set up a BigQuery Cloud resource connection named my_connection in the us multi-region and granted the associated service account the required Vertex AI permissions.
Which Data Definition Language (DDL) statement should the team run in BigQuery to register a remote model that connects through this external connection?
my_project.my_dataset.remote_llm WITH CONNECTION my_project.us.my_connection OPTIONS (ENDPOINT = 'https://us-central1-aiplatform.googleapis.com/v1/...');This statement attempts to create an External Table (CREATE OR REPLACE EXTERNAL TABLE) pointing to a machine learning endpoint.
format, uris, and sheet_range. They do not support machine learning parameters such as ENDPOINT or Vertex AI foundation models.ML.GENERATE_TEXT or ML.PREDICT require a model resource (MODEL), not a table resource.WITH CONNECTION to access storage buckets with delegated permissions.The requirement were to query Parquet or CSV data files stored in an external Cloud Storage bucket via a BigQuery Cloud resource connection.
my_project.my_dataset.remote_llm IMPORT FROM CONNECTION my_project.us.my_connection OPTIONS (MODEL_TYPE = 'VERTEX_AI');This option attempts to register an external model using an invalid IMPORT FROM CONNECTION SQL clause combined with a fictional MODEL_TYPE = 'VERTEX_AI' option.
IMPORT FROM or IMPORT FROM CONNECTION statement. Remote models must be declared using the REMOTE WITH CONNECTION clause.MODEL_TYPE is not used with an argument of 'VERTEX_AI' to establish a remote connection; instead, remote models configure the connection via REMOTE WITH CONNECTION and set the target via ENDPOINT or REMOTE_SERVICE_TYPE.BigQuery ML utilized an IMPORT FROM CONNECTION keyword syntax for loading model binaries directly into BigQuery tables, which is not part of GoogleSQL standard syntax.
my_project.my_dataset.remote_llm REMOTE WITH CONNECTION my_project.us.my_connection OPTIONS (ENDPOINT = 'https://us-central1-aiplatform.googleapis.com/v1/projects/my_project/locations/us-central1/publishers/google/models/text-bison');A remote model in BigQuery ML acts as a reference to a machine learning model or service hosted outside BigQuery's native execution engine, such as a foundation model deployed on Vertex AI or a Cloud AI service. Defining a remote model allows SQL developers and data analysts to run inference directly against powerful external models using standard BigQuery SQL statements without extracting data or writing bespoke Python client code.

CREATE OR REPLACE MODEL followed by the dataset and model resource name.REMOTE WITH CONNECTION paired with the fully qualified connection path (my_project.us.my_connection), allowing BigQuery to use the connection's delegated service account credentials.OPTIONS clause specifies the ENDPOINT (or model name) pointing to the corresponding Vertex AI service endpoint in the designated location.ML.GENERATE_TEXT or ML.PREDICT.This statement uses the exact GoogleSQL DDL syntax designed for registering external and remote models. It encapsulates the connection identifier and target endpoint parameters cleanly within the standard REMOTE WITH CONNECTION definition.
my_project.my_dataset.remote_llm TRANSFORM (REMOTE_CONNECTION = 'my_project.us.my_connection') AS SELECT * FROM my_project.my_dataset.training_data;This statement constructs an internal model training query using an AS SELECT query block with a TRANSFORM clause, attempting to pass the connection as a feature transformation parameter.
AS SELECT ... clause is used for training internally trained models (such as Linear Regression, Logistic Regression, or K-means clustering). Remote models do not train on rows in BigQuery and do not take an AS SELECT training query.TRANSFORM clause in BigQuery ML is used to specify manual feature preprocessing functions (e.g., ML.STANDARD_SCALER, ML.BUCKETIZE) during training, not for specifying external connection parameters.REMOTE WITH CONNECTION required to link the model resource to BigQuery's connection framework.AS SELECT query to ingest training features and target labels from BigQuery tables.You were training a built-in supervised BigQuery ML model (such as a logistic regression or boosted tree model) and applying custom feature preprocessing rules using SQL functions.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated