BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Analyzing Business Data in SQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

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;
Kodu Düzenle ve Çalıştır