ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 54 - Professional Data Engineer discussion

Report
Export

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?

A.
Add ", UNNEST(person)" before the WHERE clause.
Answers
A.
Add ", UNNEST(person)" before the WHERE clause.
B.
Change "person" to "person.city".
Answers
B.
Change "person" to "person.city".
C.
Change "person" to "city.person".
Answers
C.
Change "person" to "city.person".
D.
Add ", UNNEST(city)" before the WHERE clause.
Answers
D.
Add ", UNNEST(city)" before the WHERE clause.
Suggested answer: A

Explanation:

To access the person.city column, you need to "UNNEST(person)" and JOIN it to table1 using a comma.

Reference:

https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacysql#nested_repeated_results

asked 18/09/2024
Danyail Storey
28 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first