ComenzarEmpieza gratis

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 ejercicio forma parte del curso

Analyzing Business Data in SQL

Ver curso

Instrucciones del ejercicio

  • 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.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

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 y ejecutar código