Your question is SQL for Monthly Aggregates. Start with the requirements and the three 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.
DigitalOcean's Financial Analytics team needs a monthly view of customer satisfaction for active paid accounts. Write a PostgreSQL query for January through April 2025.
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(120) | Customer account name |
| segment | VARCHAR(30) | Customer business segment |
| is_internal | BOOLEAN | Whether the account is an internal DigitalOcean account |
| Column | Type | Description |
|---|---|---|
| subscription_idPK | INT | Unique subscription identifier |
| customer_id | INT | Referenced customer |
| plan_name | VARCHAR(60) | DigitalOcean subscription plan |
| started_at | DATE | Subscription start date |
| ended_at | DATE | Subscription end date, if ended |
| Column | Type | Description |
|---|---|---|
| response_idPK | INT | Unique survey response identifier |
| customer_id | INT | Customer submitting the response |
| submitted_at | TIMESTAMP | Response submission timestamp |
| score | INT | Customer satisfaction score from 1 through 5 |
| response_channel | VARCHAR(30) | Channel used to submit the response |