Given a schema with users, subscriptions, and payments, write a SQL query using joins and group by to find the total revenue generated per subscription tier last month.
Use calendar-month boundaries and include payment amounts recorded during the previous calendar month.
Output
- Return one row per subscription tier with columns
subscription_tier and total_revenue.
- Include only tiers with matching users, subscriptions, and payments from last month.
- Order results alphabetically by
subscription_tier.