Monthly Recurring Revenue
Medium
Subscription Metrics
Compute the monthly recurring revenue on 2026-10-01: the sum of monthly_fee over subscriptions that started on or before that date and have no end_date or an end_date on or after it.
Table schema
Subscriptions(id INT PRIMARY KEY, user_id INT, monthly_fee INT, start_date DATE, end_date DATE NULL)Sample data
id | user_id | monthly_fee | start_date | end_date
1 | 1 | 100 | 2026-01-01 | NULL
2 | 2 | 50 | 2026-05-01 | 2026-09-30
3 | 3 | 70 | 2026-09-01 | 2026-12-31
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.