Alpaca wants to compare user engagement among customers who joined during the same month. Write a PostgreSQL query that ranks users by their qualifying Alpaca app activity within each signup-month cohort.
YYYY-MM format.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique Alpaca user identifier |
| display_name | VARCHAR(100) | User display name |
| signup_date | DATE | Date the user joined Alpaca |
| Column | Type | Description |
|---|---|---|
| event_idPK | INTEGER | Unique activity event identifier |
| user_id | INTEGER | User associated with the event |
| event_type | VARCHAR(50) | Type of Alpaca app activity |
| occurred_at | TIMESTAMP | Timestamp when the activity occurred |