Publicis Groupe analysts are evaluating regional engagement across a digital audience platform. Write a PostgreSQL query that measures distinct active users during the trailing 30-day window ending on 2024-02-01, assigns each region an engagement tier, and ranks regions within their tier.
users to user_activity while retaining regions whose users had no qualifying activity.High for at least 3 active users, Medium for 1 or 2, and Low for 0.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| region | VARCHAR(50) | Geographic region assigned to the user |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity event identifier |
| user_id | INT | User associated with the activity event |
| activity_date | DATE | Calendar date on which the activity occurred |