Nimbus Logistics wants a simple view of operational workload over time. Write a PostgreSQL query to analyze monthly support ticket trends from a single table.
created_at date.YYYY-MM format and the total number of tickets created in that month.created_at is NULL.support_tickets
| column | type | description |
|---|---|---|
| ticket_id | INT | Primary key for each ticket |
| team_name | VARCHAR(50) | Team handling the ticket |
| priority | VARCHAR(20) | Ticket priority level |
| status | VARCHAR(20) | Current ticket status |
| created_at | DATE | Date the ticket was created |
| ticket_id | team_name | priority | status | created_at |
|---|---|---|---|---|
| 1 | Fulfillment | High | Open | 2024-03-02 |
| 2 | Warehouse | Medium | Closed | 2024-01-15 |
| 3 | Fulfillment | Low | Open | 2024-02-10 |
| 4 | Returns | High | Closed | 2024-01-28 |
| 5 | Warehouse | Medium | Open | 2024-03-18 |
| 6 | Fulfillment | Low | Closed | 2024-02-25 |
| 7 | Returns | Medium | Open | 2024-01-03 |
| 8 | Warehouse | High | Open | NULL |
| 9 | Fulfillment | Medium | Closed | 2024-03-01 |
| 10 | Returns | Low | Open | 2024-02-14 |
| ticket_month | ticket_count |
|---|---|
| 2024-01 | 3 |
| 2024-02 | 3 |
| 2024-03 | 3 |
| Column | Type | Description |
|---|---|---|
| ticket_idPK | INT | Primary key for each support ticket |
| team_name | VARCHAR(50) | Operations team responsible for the ticket |
| priority | VARCHAR(20) | Priority assigned to the ticket |
| status | VARCHAR(20) | Current ticket status |
| created_at | DATE | Date the ticket was created |
{"support_tickets":[["1","Fulfillment","High","Open","2024-03-02"],["2","Warehouse","Medium","Closed","2024-01-15"],["3","Fulfillment","Low","Open","2024-02-10"],["4","Returns","High","Closed","2024-01-28"],["5","Warehouse","Medium","Open","2024-03-18"],["6","Fulfillment","Low","Closed","2024-02-25"],["7","Returns","Medium","Open","2024-01-03"],["8","Warehouse","High","Open",null],["9","Fulfillment","Medium","Closed","2024-03-01"],["10","Returns","Low","Open","2024-02-14"],["11","Customer SupporOutput[["2024-01","10"],["2024-02","10"],["2024-03","3"]]