Your question is Monthly Active Users Query. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
TransUnion CreditVision needs a monthly engagement metric showing how many eligible users interacted with the product. The source contains both user account status and timestamped product events.
Write a PostgreSQL query to calculate monthly active users from the events table.
account_status is active.login, report_view, and score_check as active events. Exclude other event types and rows with a NULL event name.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique user identifier |
| account_status | VARCHAR(20) | Current account status |
| Column | Type | Description |
|---|---|---|
| event_idPK | INTEGER | Unique event identifier |
| user_id | INTEGER | User who generated the event |
| occurred_at | TIMESTAMP | Timestamp when the event occurred |
| event_name | VARCHAR(30) | Type of product event |