Given an API schema, write JavaScript code to fetch data and process it.
Asked in the Online assessment stage. For the PostgreSQL representation below, write a query that processes users and their events for January 2025.
user_id, email, successful_event_count, successful_amount, and latest_successful_event_at.user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique API user identifier |
| VARCHAR(255) | User email address | |
| deleted_at | TIMESTAMP | Timestamp when the user was deleted |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | User associated with the event |
| event_type | VARCHAR(50) | Type of API event |
| status | VARCHAR(20) | Processing status of the event |
| amount | NUMERIC(10,2) | Optional event amount |
| occurred_at | TIMESTAMP | Event occurrence timestamp |