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.
Deze oefening maakt deel uit van de cursus
Analyzing Business Data in SQL
Oefeninstructies
- Store revenue and the number of unique active users by week in the
kpiCTE. - Calculate ARPU by dividing the revenue by the number of users.
- Order the results by week in ascending order.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
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;