End of Summer - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Customer activity
Finding good customers
Summary

Instruction

Fantastic job! Let's do one more exercise.

Exercise

Find the number of good customers (defined as those with an average order value greater than 1500.00) in weekly registration and city cohorts (i.e., cohorts defined by both weekly registration and the customer's city). Show the following columns: Year, Week, City, and GoodCustomers. Order the results by year and week.

Stuck? Here's a hint!

Inside the CTE, select CustomerID, RegistrationDate, City, and AVG(TotalAmount) based on the Customers and Orders tables. Introduce a HAVING clause.

Use this information in the outer query.