Executive report
Eve wants to produce a final executive report about the rankings of eateries by the number of unique users who order from them by quarter. She said she'll handle the pivoting, so you only need to prepare the source table for her to pivot.
Send Eve a table of unique ordering users by eatery and by quarter.
This exercise is part of the course
Analyzing Business Data in SQL
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT
eatery,
-- Format the order date so "2018-06-01" becomes "Q2 2018"
TO_CHAR(order_date, ___) AS delivr_quarter,
-- Count unique users
___ AS users
FROM meals
JOIN orders ON meals.meal_id = orders.meal_id
GROUP BY eatery, delivr_quarter
ORDER BY delivr_quarter, users;