Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Customer activity
Finding good customers
Summary

Instruction

Good job! Let's do one more exercise to practice writing queries with Common Table Expressions.

Exercise

Find out the average number of orders placed in the last 180 days by customers who have been active (made a purchase) in the last 30 days. Name the column avg_order_count.

In the Common Table Expression determine the number of orders placed in the last 180 days by each active customer. Then, in the outer query determine the average.

Stuck? Here's a hint!