Practice Test 4 | Google Cloud Certified Professional Data Engineer | Dumps | Mock Test
You have a table company which includes a nested column called “financial_group” inside a column called “department”. While querying below query in Big Query an error is received:
SELECT department From `project1.branch.company` WHERE financial_group=””CORPORATE_OPERATION””;
How can the error be corrected?
A. Change “department” to “department.financial_group”.
B. Add “, UNNEST(department)” before the WHERE clause.
C. Change “department” to “financial_group.department”.
D. Add “, UNNEST(financial_group)” before the WHERE clause.
Correct answer is B.
Option B is correct. As the department column needs to be UNNEST for the nested financial_group field to be used directly in WHERE clause. Please refer GCP documentation for more information – https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql
Comments are closed, but trackbacks and pingbacks are open.