ComeçarComece de graça

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.

Este exercício faz parte do curso

Analyzing Business Data in SQL

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

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;
Editar e executar o código