PCDE Design and implement database schemas Practice Question
This PCDE practice question tests your understanding of design and implement database schemas. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Why wrong: This query does not flatten the items array; it only filters out rows where items is NULL, leaving the array structure intact.
B
SELECT * FROM orders, UNNEST(items) AS items
Why wrong: This query uses implicit CROSS JOIN with UNNEST, which is syntactically valid but not the standard BigQuery syntax for flattening arrays. The explicit CROSS JOIN UNNEST is preferred and required in this exam context.
C
SELECT * FROM orders INNER JOIN items ON true
Why wrong: INNER JOIN requires a table, not an array. items is an array column, so this syntax is invalid.
D
SELECT * FROM orders CROSS JOIN UNNEST(items) AS items
This is correct because CROSS JOIN UNNEST expands the items array into separate rows, preserving other order columns.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
SELECT * FROM orders CROSS JOIN UNNEST(items) AS items
Option D is correct because `CROSS JOIN UNNEST(items)` is the standard BigQuery syntax to flatten a repeated (array) column into individual rows. The `UNNEST` operator expands each array element into a separate row, and `CROSS JOIN` ensures that all non-array columns from the `orders` table are preserved alongside each element. This is the only option that correctly transforms the nested `items` array into a normalized row-per-item structure.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
SELECT * FROM orders WHERE items IS NOT NULL
Why it's wrong here
This query does not flatten the items array; it only filters out rows where items is NULL, leaving the array structure intact.
✗
SELECT * FROM orders, UNNEST(items) AS items
Why it's wrong here
This query uses implicit CROSS JOIN with UNNEST, which is syntactically valid but not the standard BigQuery syntax for flattening arrays. The explicit CROSS JOIN UNNEST is preferred and required in this exam context.
✗
SELECT * FROM orders INNER JOIN items ON true
Why it's wrong here
INNER JOIN requires a table, not an array. items is an array column, so this syntax is invalid.
✓
SELECT * FROM orders CROSS JOIN UNNEST(items) AS items
Why this is correct
This is correct because CROSS JOIN UNNEST expands the items array into separate rows, preserving other order columns.
Related concept
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The Google Cloud Professional Data Engineer exam often tests the requirement that `UNNEST` must be paired with a join (like `CROSS JOIN` or `LEFT JOIN`) and that using `UNNEST` alone or with a `WHERE` clause is syntactically invalid in BigQuery, leading candidates to mistakenly choose Option B.
Detailed technical explanation
How to think about this question
Under the hood, BigQuery stores repeated columns as arrays in its columnar storage format (Capacitor). The `UNNEST` operator converts each element of the array into a virtual table, and `CROSS JOIN` (or `LEFT JOIN`) is required to correlate the array elements back to the parent row. A subtle behavior is that if the array is empty or NULL, `CROSS JOIN UNNEST` will drop the parent row entirely; to preserve parent rows with empty arrays, use `LEFT JOIN UNNEST(...)`. In real-world scenarios, this is critical for processing event logs or order line items stored as nested arrays.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A startup's cloud architect reviews their monthly bill and notices costs are higher than expected for a long-running batch job. Switching from on-demand instances to Reserved Instances — or using Spot/Preemptible VMs — can reduce compute costs by up to 72 %. Questions like this test whether you understand the tradeoffs between commitment, flexibility, and cost across cloud pricing models.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Design and implement database schemas — This question tests Design and implement database schemas — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: SELECT * FROM orders CROSS JOIN UNNEST(items) AS items — Option D is correct because `CROSS JOIN UNNEST(items)` is the standard BigQuery syntax to flatten a repeated (array) column into individual rows. The `UNNEST` operator expands each array element into a separate row, and `CROSS JOIN` ensures that all non-array columns from the `orders` table are preserved alongside each element. This is the only option that correctly transforms the nested `items` array into a normalized row-per-item structure.
What should I do if I get this PCDE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This PCDE 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 PCDE exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.