Your question is SQL for Bank Customer Expenses. 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.
Fidelity Full View aggregates a customer's financial activity across connected accounts. A reporting team needs to identify each customer's peak monthly spending period.
Write a PostgreSQL query that groups monthly expense records by Fidelity Full View customer and returns the month with the highest combined expense across all expense columns.
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Fidelity customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| Column | Type | Description |
|---|---|---|
| expense_idPK | INT | Unique monthly expense record identifier |
| customer_id | INT | Customer associated with the expense record |
| expense_month | DATE | First day of the expense month |
| housing_expense | NUMERIC(12,2) | Monthly housing expense |
| groceries_expense | NUMERIC(12,2) | Monthly grocery expense |
| utilities_expense | NUMERIC(12,2) | Monthly utility expense |
| transport_expense | NUMERIC(12,2) | Monthly transportation expense |