Welcome to the SQL screen.
The question is on your right: Monthly Active User Growth by Platform. Read through the requirements and the three tables first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
You are given user activity data for Google products. Write a SQL query to calculate the month-over-month growth rate of active users for a specific platform, using Google Maps as the target product. Treat an active user as a distinct user with at least one activity event in that month. Return each month, the active user count, the prior month's active user count, and the month-over-month growth rate as a percentage. For the first month in the result, the prior month and growth rate should be NULL.
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(100) | Google product name |
| platform | VARCHAR(20) | Platform where the product is used |
| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| country_code | VARCHAR(2) | User country code |
| signup_date | DATE | Date the user signed up |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | User who generated the event |
| product_id | INT | Product tied to the event |
| event_date | DATE | Date of the activity event |
| event_type | VARCHAR(30) | Type of user activity |