Challenge: BigQuery Data Selection
Swipe to show menu
In the video and course examples, you will see the JSON_EXTRACT function. While this function is fully supported and works correctly, it is considered legacy syntax in BigQuery.
For your own future projects, we recommend using the modern standard functions:
JSON_VALUE: extracts scalar values (like strings or numbers) and removes extra quotes automatically;JSON_QUERY: extracts complex JSON objects or arrays.
Task
Your task is to analyze customer shopping patterns while demonstrating your understanding of BigQuery's specialized features.
- Write a query that uses partition pruning by filtering on the appropriate partition column (
_PARTITIONDATE); - Use
APPROX_COUNT_DISTINCTto efficiently count unique customers; - Include at least one
JSONextraction from the products field; - Group your results in a meaningful way.
To use _PARTITIONDATE for partition pruning, ensure the BigQuery table is created with Partition by: Ingestion time. Without this setting, the pseudo-column will not exist, and the query will fail.
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Challenge: BigQuery Data Selection
In the video and course examples, you will see the JSON_EXTRACT function. While this function is fully supported and works correctly, it is considered legacy syntax in BigQuery.
For your own future projects, we recommend using the modern standard functions:
JSON_VALUE: extracts scalar values (like strings or numbers) and removes extra quotes automatically;JSON_QUERY: extracts complex JSON objects or arrays.
Task
Your task is to analyze customer shopping patterns while demonstrating your understanding of BigQuery's specialized features.
- Write a query that uses partition pruning by filtering on the appropriate partition column (
_PARTITIONDATE); - Use
APPROX_COUNT_DISTINCTto efficiently count unique customers; - Include at least one
JSONextraction from the products field; - Group your results in a meaningful way.
To use _PARTITIONDATE for partition pruning, ensure the BigQuery table is created with Partition by: Ingestion time. Without this setting, the pseudo-column will not exist, and the query will fail.
Thanks for your feedback!