Average orders per user
Dave wants to add the average orders per user value to his unit economics study, since more orders usually correspond to more revenue.
Calculate the average orders per user for Dave.
Note: The count of distinct orders is different than the sum of ordered meals. One order can have many meals within it. Average orders per user depends on the count of orders, not the sum of ordered meals.
This is a part of the course
“Analyzing Business Data in SQL”
Exercise instructions
- Store the count of distinct orders and distinct users in the
kpi
CTE. - Calculate the average orders per user.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
WITH kpi AS (
SELECT
-- Select the count of orders and users
___ AS orders,
___ AS users
FROM orders)
SELECT
-- Calculate the average orders per user
ROUND(
___ :: ___ / ___,
2) AS arpu
FROM kpi;
This exercise is part of the course
Analyzing Business Data in SQL
Learn to write SQL queries to calculate key metrics that businesses use to measure performance.
Since a KPI is a single number, it can't describe how data is distributed. In this chapter, you'll learn about unit economics, histograms, bucketing, and percentiles, which you can use to spot the variance in user behaviors.
Exercise 1: Unit economicsExercise 2: Average revenue per userExercise 3: ARPU per weekExercise 4: Average orders per userExercise 5: HistogramsExercise 6: Histogram of revenueExercise 7: Histogram of ordersExercise 8: BucketingExercise 9: Bucketing users by revenueExercise 10: Bucketing users by ordersExercise 11: PercentilesExercise 12: Revenue quartilesExercise 13: Interquartile rangeWhat is DataCamp?
Learn the data skills you need online at your own pace—from non-coding essentials to data science and machine learning.