Get startedGet started for free

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.

This exercise is part of the course

Analyzing Business Data in SQL

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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;
Edit and Run Code