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
.
This exercise is part of the course
Introduction to BigQuery
Exercise instructions
- Select the ten smallest orders from the
ecommerce.ecomm_payments
usingSUM
on thepayment_value
column for the first 10 rows of data.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- 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 ___;