Your question is Compare Segment Performance Over Time. 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.
Write a PostgreSQL query that compares monthly performance across active segments in an Equifax-style reporting model. Your result should show every active segment for every reporting month, including months with no applications, and calculate application volume, approvals, approval rate, revenue, and month-over-month revenue change.
| Column | Type | Description |
|---|---|---|
| segment_id | ||
| segment_name | ||
| is_active |
| Column | Type | Description |
|---|---|---|
| application_id | ||
| segment_id | ||
| application_date | ||
| status | ||
| revenue |
| Column | Type | Description |
|---|---|---|
| month_start |