Get startedGet started for free

Perform optimizations in BigQuery

So far in this chapter, you have learned several methods to query data in BigQuery that make the most of the architecture of BigQuery. In this set of exercises, you will put those concepts into practice while optimizing a query. Imagine that you have been tasked to write a query for your finance department that provides information about the number of customers using payment plans over the last 90 days. The report will show:

  • The number of customers using a payment plan
  • Grouped by the number of payment installments
  • The average payment per installment for each group

This exercise will take you through some of the steps to build this query while also working to practice query optimizations at each step.

This exercise is part of the course

Introduction to BigQuery

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

SELECT
	p.payment_installments,
	COUNT(p.order_id)                      
FROM ecommerce.ecomm_payments p
-- Add the join conditions 
JOIN ecommerce.ecomm_order_details o ___ (___)
-- Group by the payment_installments column
GROUP BY p.___
Edit and Run Code