ComeçarComece de graça

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.

Este exercício faz parte do curso

Introduction to BigQuery

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

-- Complete the query to approximate the number of customers that have ordered each product

SELECT
  items.product_id,
  -- Add the correct syntax for the approximate distinct count
  ___ AS estimated_unique_customers
FROM ecommerce.ecomm_orders o, UNNEST(o.order_items) items
JOIN ecommerce.ecomm_order_details od USING (order_id)
GROUP BY items.product_id;
Editar e executar o código