Agent share of their team's tickets
The task
The support lead wants to see how evenly work is spread inside each team. A ticket belongs to its assigned agent (tickets.agent_id); tickets with no assigned agent belong to nobody and are ignored.
Return one row per agent, including agents with no tickets:
agent_idfull_nameteamtickets: tickets assigned to the agentteam_tickets: tickets assigned to any agent on the same teampct_of_team:ticketsas a percentage ofteam_tickets, rounded to 1 decimal place
Sort by team and then agent_id. Every team in the data has at least one ticket.
Expected output
agent_idfull_nameteamticketsteam_ticketspct_of_team- Sorted by team ascending, then agent_id ascending.
- Numbers rounded to 1 decimal place.
- Checked on the sample and on 2 hidden datasets. How grading works
Tables Customer support desk · click a name to insert it
agents14 rows in the sample
Support agents. Key: agent_id.
| int | Unique id. | |
| text | Name. | |
| text | billing, technical or general. | |
| date | Start day. |
tickets900 rows in the sample
One row per ticket. Key: ticket_id.
| int | Unique id. | |
| int | Who opened it. | |
| int | Assigned agent. NULL if never assigned. | |
| text | email, chat or phone. | |
| text | low, normal, high or urgent. | |
| text | billing, bug, how_to or account. | |
| timestamp | Opened (UTC). | |
| timestamp | First reply from an agent. NULL if none yet. | |
| timestamp | Closed as solved. NULL while open. |
satisfaction366 rows in the sample
Survey answers, at most one per ticket. Key: ticket_id.
| int | The ticket. | |
| int | 1 (very unhappy) to 5 (very happy). | |
| timestamp | When answered (UTC). |
Related questions
- Ticket categories with an above-average urgent sharemedium
- Campaigns cheaper per sign-up than their channelhard
- Listeners whose first play was on a speakermedium
- Average transactions per open accountmedium
- Buyers whose latest purchase beat their earlier averagehard
- Customers whose first order used a couponmedium
Loading the editor and PostgreSQL
Loading the editor and PostgreSQL