ComeçarComece de graça

ARPU per week

Next, Dave wants to see whether ARPU has increased over time. Even if Delivr's revenue is increasing, it's not scaling well if its ARPU is decreasing—it's generating less revenue from each of its customers.

Send Dave a table of ARPU by week using the second way discussed in Lesson 3.1.

Este exercício faz parte do curso

Analyzing Business Data in SQL

Ver curso

Instruções do exercício

  • Store revenue and the number of unique active users by week in the kpi CTE.
  • Calculate ARPU by dividing the revenue by the number of users.
  • Order the results by week in ascending order.

Exercício interativo prático

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

WITH kpi AS (
  SELECT
    -- Select the week, revenue, and count of users
    ___ :: ___ AS delivr_week,
    ___ AS revenue,
    ___ AS users
  FROM meals AS m
  JOIN orders AS o ON m.meal_id = o.meal_id
  GROUP BY delivr_week)

SELECT
  delivr_week,
  -- Calculate ARPU
  ROUND(
    ___ :: ___ / ___,
  2) AS arpu
FROM kpi
-- Order by week in ascending order
ORDER BY ___ ASC;
Editar e executar o código