Write a query to find the active users who performed a specific action consecutively for three or more days.
Use sync_completed as the specific action. Treat multiple events on the same user and date as one active day.
user_id, user_name, streak_start_date, streak_end_date, and consecutive_days.user_id, then streak_start_date.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | Display name of the user |
| is_active | BOOLEAN | Whether the user is currently active |
| last_login_at | TIMESTAMP | Most recent login timestamp |
| Column | Type | Description |
|---|---|---|
| action_idPK | INT | Unique action event identifier |
| user_id | INT | User who performed the action |
| action_name | VARCHAR(100) | Name of the performed action |
| occurred_at | TIMESTAMP | Timestamp when the action occurred |