How many orders does one customer place on average? To answer, you need two steps: first count each customer's orders, then average those numbers. The first step is GROUP BY with count(*), the second is avg over the result.
In this lesson
- A table from a subquery
- A subquery in FROM in a join
- Common mistake
- Key points