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.
Cet exercice fait partie du cours
Analyzing Business Data in SQL
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de 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;