Mark As Completed Discussion

Try this exercise. Click the correct answer from the options.

Imagine you have a table similar as the one above, but instead of having a column NumberOfItems, each order of each customer is recorded as a separate row. That is, there would be 3 rows with the name Steve, 2 for Alex, etc. Moreover, we have the following query:

TEXT/X-SQL
1WITH number_orders AS (
2        SELECT Name,
3                COUNT(*) AS order_count
4        FROM table
5        GROUP BY customerID)
6 
7SELECT AVG(order_count) AS avg_order_count
8FROM number_orders

In case we run this query on the table, what would we get?

Click the option that best answers the question.

  • The name of the person that made the highest number of orders
  • The average number of orders per customer
  • The total number of people that made that specific amount of orders (for each amount)