Acumen wants to identify its most engaged users in each region. As of February 15, 2025, write a PostgreSQL query to find the top three users per region based on engagement points earned during the previous 30 days.
Requirements
- Include engagement events from January 16 through February 15, 2025, inclusive.
- Sum each user's non-null
score within the period.
- Rank users independently within each region using
ROW_NUMBER(), ordering by total score descending and user_id ascending as the tie-breaker.
- Return only ranks 1 through 3, with regions ordered alphabetically and users ordered by rank.