Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Monthly Recurring Revenue

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.