PMLE Architecting Low-Code ML Solutions Practice Question
A company wants to build a recommendation system that suggests products to users based on their past purchase history. They have a large dataset of user-item interactions in BigQuery and want to use a low-code approach. They decide to use BigQuery ML's matrix factorization model. Which SQL statement correctly creates such a model?
⚠ Common exam trap
The trap here is using incorrect options like input_label_cols for matrix factorization, which requires user_col, item_col, and rating_col.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
CREATE MODEL `project.dataset.recommender` OPTIONS(model_type='matrix_factorization', user_col='user_id', item_col='product_id', rating_col='rating') AS SELECT user_id, product_id, rating FROM `project.dataset.interactions`
The correct SQL statement creates a matrix factorization model in BigQuery ML, specifying the user column, item column, and rating column. This model uses collaborative filtering to learn latent factors for users and items, enabling personalized recommendations. It is a low-code solution that requires only SQL and scales to large datasets, making it ideal for the company's needs.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
CREATE MODEL `project.dataset.recommender` OPTIONS(model_type='kmeans', num_clusters=10) AS SELECT user_id, product_id, rating FROM `project.dataset.interactions`
Why it's wrong here
This statement creates a k-means clustering model, which is used for unsupervised clustering, not for recommendation. K-means does not leverage user-item interactions to make recommendations. The company needs a collaborative filtering approach, which matrix factorization provides. Therefore, this statement does not meet the requirements.
- ✗
CREATE MODEL `project.dataset.recommender` OPTIONS(model_type='logistic_reg', user_col='user_id', item_col='product_id', rating_col='rating') AS SELECT user_id, product_id, rating FROM `project.dataset.interactions`
Why it's wrong here
This statement attempts to create a logistic regression model with options meant for matrix factorization. Logistic regression is used for binary classification, not for collaborative filtering. The options user_col, item_col, and rating_col are not valid for logistic regression. Therefore, this statement will fail to create a proper recommendation model.
- ✓
CREATE MODEL `project.dataset.recommender` OPTIONS(model_type='matrix_factorization', user_col='user_id', item_col='product_id', rating_col='rating') AS SELECT user_id, product_id, rating FROM `project.dataset.interactions`
Why this is correct
This statement correctly creates a matrix factorization model in BigQuery ML. It specifies the model type as matrix_factorization and identifies the user column, item column, and rating column. The SELECT statement provides the training data with user-item interactions and ratings. This is the standard syntax for building a recommendation model using collaborative filtering in BigQuery ML.
- ✗
CREATE MODEL `project.dataset.recommender` OPTIONS(model_type='matrix_factorization', input_label_cols=['rating']) AS SELECT user_id, product_id, rating FROM `project.dataset.interactions`
Why it's wrong here
This statement uses the model type matrix_factorization but incorrectly specifies input_label_cols instead of the required user_col, item_col, and rating_col options. Matrix factorization requires those specific options to identify the user and item columns. Without them, the model cannot be trained correctly. Thus, this statement is incorrect.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PMLE question from scratch — 775 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.