nerdexam
Google

PROFESSIONAL-DATA-ENGINEER · Question #54

Suppose you have a table that includes a nested column called "city" inside a column called "person", but when you try to submit the following query in BigQuery, it gives you an error. SELECT person…

The correct answer is A. Add ", UNNEST(person)" before the WHERE clause. Explanation/Reference: To access the person.city column, you need to "UNNEST(person)" and JOIN it to table1 using a comma. https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#nested_repeated_results

Submitted by parkjh· Mar 30, 2026Building and operationalizing data processing systems

Question

Suppose you have a table that includes a nested column called "city" inside a column called "person", but when you try to submit the following query in BigQuery, it gives you an error. SELECT person FROM project1.example.table1 WHERE city = "London" How would you correct the error?

Options

  • AAdd ", UNNEST(person)" before the WHERE clause.
  • BChange "person" to "person.city".
  • CChange "person" to "city.person".
  • DAdd ", UNNEST(city)" before the WHERE clause.

How the community answered

(36 responses)
  • A
    94% (34)
  • C
    3% (1)
  • D
    3% (1)

Explanation

Explanation/Reference: To access the person.city column, you need to "UNNEST(person)" and JOIN it to table1 using a comma. https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#nested_repeated_results

Topics

#BigQuery nested fields#UNNEST#SQL syntax#repeated records

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-DATA-ENGINEER Practice