Finding order total value
A common use case for BigQuery is creating analytical reports, such as finding the top 10 results from a query or results within a certain timespan.
For this query, you will find the 10 smallest orders by total cost using the ecommerce.ecomm_payments.
Deze oefening maakt deel uit van de cursus
Introduction to BigQuery
Oefeninstructies
- Select the ten smallest orders from the
ecommerce.ecomm_paymentsusingSUMon thepayment_valuecolumn for the first 10 rows of data.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
-- Add the correct column and limit values
SELECT
-- Add the column to calculate the SUM
order_id, SUM(___)
FROM
ecommerce.ecomm_payments
GROUP BY order_id
-- Add the correct column to order
ORDER BY ___
-- Add the correct number of rows to limit
LIMIT ___;