始める無料で始める

近似統計関数

GoogleSQL には、大規模データセットでより高いパフォーマンスを発揮する4つの近似集計関数があります: APPROX_COUNT_DISTINCTAPPROX_QUANTILESAPPROX_TOP_COUNTAPPROX_TOP_SUM。この演習では、各関数を使って同じクエリを順に実行していきます。

この演習はコースの一部です

BigQuery入門

コースを見る

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

-- 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;
コードを編集して実行