Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
SQL for Team Performance
00:00
5 left

SQL for Team Performance

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze operational performance by team at NiCE, including joins across relevant tables and aggregations for key metrics. Use the provided tables and data to calculate team-level operational results.

Output

  1. One row per team, including teams with no qualifying interactions.
  2. Columns: team_name, active_agents, total_interactions, resolved_interactions, avg_handle_minutes, and resolution_rate_pct.
  3. Include interactions from January 2025, sort by resolution rate descending, then total interactions descending, then team name ascending.

Schema

teams
ColumnTypeDescription
team_idPKINTUnique team identifier
team_nameVARCHAR(100)NiCE operational team name
regionVARCHAR(50)Primary operating region
agents
ColumnTypeDescription
agent_idPKINTUnique agent identifier
team_idINTAssigned operational team
agent_nameVARCHAR(100)Agent display name
activeBOOLEANWhether the agent is currently active
interactions
ColumnTypeDescription
interaction_idPKINTUnique interaction identifier
agent_idINTAgent handling the interaction
occurred_atTIMESTAMPInteraction start timestamp
statusVARCHAR(30)Operational status of the interaction
handle_minutesDECIMAL(8,2)Duration in minutes when available
Tablesteamsagentsinteractions
Interviewer

Your question is SQL for Team Performance. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.