mediumMultiple Choice
PDE A company uses BigQuery for analytics Practice Question
A company uses BigQuery for analytics. They need to ensure data quality by preventing duplicate records from being inserted. Which approach is most effective?
⚠ Common exam trap
Google Cloud certifications often test the misconception that data quality tools like DLP or ML can solve structural data integrity problems, when in fact the correct approach is to use native DML operations (like MERGE) that enforce uniqueness at write time.
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
✓
Use a DML MERGE statement that filters out duplicates based on a unique key.
BigQuery's DML MERGE statement can be used to atomically insert rows only when a unique key does not already exist in the target table. By using a MERGE with a WHEN NOT MATCHED THEN INSERT clause, the operation prevents duplicate records from being inserted in a single, transactional statement, ensuring data quality without requiring external tools or post-processing.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use BigQuery ML to train a model that identifies anomalies.
Why it's wrong here
BigQuery ML trains predictive models on existing data; it detects anomalies after ingestion rather than blocking duplicate rows at insert time. It would be correct for forecasting or outlier detection. Preventing duplicates requires a primary key or MERGE constraint on the target table.
- ✓
Use a DML MERGE statement that filters out duplicates based on a unique key.
Why this is correct
A MERGE statement performs conditional upsert logic, matching incoming rows against existing records on a unique key so only new or changed rows are written. This prevents duplicate insertion at the query level, satisfying the data-quality constraint more reliably than post-load deduplication or table constraints alone.
- ✗
Use Cloud Data Loss Prevention API to scan for duplicates.
Why it's wrong here
Cloud DLP scans and classifies sensitive data such as personally identifiable information; it does not identify or block duplicate rows. It would be correct for discovering and redacting PII across datasets. Duplicate prevention needs a uniqueness constraint or MERGE statement at write time.
- ✗
Use COUNT DISTINCT in queries to ignore duplicates.
Why it's wrong here
COUNT DISTINCT filters duplicates only within a query's result set; the duplicate rows remain stored in the table and reappear in other queries. It would be correct for ad-hoc deduplicated reporting. Preventing insertion requires a primary key or MERGE constraint on the destination table.
Go deeper
Related to this question
About these practice questions
One of 747 original PDE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PDE 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 PDE exam.