professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
Last updated
A data architect is migrating an enterprise e-commerce reporting workload from a normalized relational database to BigQuery. The existing relational model contains a parent Orders table and a child Order_Items table related by an order_id foreign key (a 1-to-many relationship).
The analytical workload frequently aggregates line items per order, but queries that join these multi-billion-row tables across compute slots suffer from significant data shuffling and high slot consumption. The architect has the following requirements:
JOIN operations.How should the architect model this schema in BigQuery?
Flatten both tables into a single wide denormalized table where each row represents an individual line item and repeats parent order attributes.
Create a single Orders table with a column defined as an ARRAY of STRUCT (repeated RECORD) types to contain the line item details.
Maintain two separate normalized tables (Orders and Order_Items) and cluster both tables on order_id to optimize relational JOIN operations.
Create a single Orders table with a JSON type column to hold line item objects, and query the items using JSON_EXTRACT_ARRAY.
Flatten both tables into a single wide denormalized table where each row represents an individual line item and repeats parent order attributes.
Create a single Orders table with a column defined as an ARRAY of STRUCT (repeated RECORD) types to contain the line item details.
In BigQuery, combining the ARRAY (repeated mode) and STRUCT (RECORD type) data types allows you to store multiple structured child objects directly inside a single parent row. This pattern creates a semi-normalized or nested schema that natively represents one-to-many parent-child relationships.
STRUCT into its own storage column. Queries referencing only order headers (e.g., order_date, customer_id) bypass the nested line item columns completely, minimizing bytes scanned and reducing query costs.LEFT JOIN UNNEST() or comma cross joins.This approach eliminates the performance bottlenecks of normalized relational joins in distributed MPP environments while preventing the storage bloat and duplicate aggregation errors associated with flat denormalization.
Maintain two separate normalized tables (Orders and Order_Items) and cluster both tables on order_id to optimize relational JOIN operations.
Create a single Orders table with a JSON type column to hold line item objects, and query the items using JSON_EXTRACT_ARRAY.