Calculate MRR from a subscriptions table using SQL

Tests your ability to translate a business metric (MRR) into a precise SQL query. A great answer filters for active subscriptions this month and sums their prices, correctly amortizing annual plans.
This tests your ability to translate a core business metric (MRR) into a precise SQL query, including date logic and handling different plan types. A strong answer first filters for subscriptions active during the current month and sums their `monthly_price`. Then, it addresses annual plans by using a `CASE` statement to divide the price by 12, amortizing the revenue. A red flag is failing to correctly identify all active subscriptions for the month or miscalculating revenue from annual plans.
Read the original → getdbt.com
- #sql
- #analytics
- #data modeling
- #business metrics
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.