On January 21th at 14:15 UTC , progression through exercises will be unavailable for 10 minutes due to a planned maintenance break.
Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Reports with revenue in categories
Revenue in time periods for selected categories


Good job! Let's try another exercise before we move on.


For each month of 2017, calculate the total revenue, and the revenue for the 'Dairy Products' and 'Seafood' categories. Show the following columns: RevenueMonth, TotalRevenue, DairyRevenue, and SeafoodRevenue. Order the results by month.

Stuck? Here's a hint!

Group the results by DATEPART(Month, OrderDate).

Calculate the DairyRevenue column as:

  WHEN C.CategoryName = 'Dairy Products'
     THEN OI.Amount
  ELSE 0.0
END) AS DairyRevenue