1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to BigQuery

Connected

Exercise

Approximate statistical functions

GoogleSQL provides four different approximate aggregate functions which provide better performance on large datasets: APPROX_COUNT_DISTINCT, APPROX_QUANTILES, APPROX_TOP_COUNT, APPROX_TOP_SUM. This exercise will take you through the same query using each function.

Instructions 1/4

undefined XP
  • 1
    • Estimate the number of unique customers for each product by applying an appropriate approximation function to the customer_id column.
  • 2
    • Estimate loyal customers for each product by identifying the TOP three customers using a suitable function on the customer_id column.
  • 3
    • Complete the query to find the approximate quantiles of item price across four bins, and filter the records to include only customers with more than eight orders.
  • 4
    • Calculate the sum of the top five highest price items by customer_id, filtering to include only customers with more than four orders.