Given a table of user events, write a SQL query to compare pre- and post-launch metrics by cohort.
Use 2025-01-15 as the launch timestamp, with 30-day pre-launch and post-launch windows. Define cohorts by the month of each user's signup date. Metrics are total events and distinct active users.
cohort_month, pre_event_count, post_event_count, pre_active_users, post_active_users, and event_count_pct_change.cohort_month ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| signup_date | DATE | Date the user signed up |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | User associated with the event |
| event_time | TIMESTAMP | Timestamp when the event occurred |
| event_name | VARCHAR(50) | Name of the recorded event |