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 Client Performance Insights
00:00
5 left

SQL for Client Performance Insights

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze operational performance by client segment at EXOS, including joins between client, activity, and satisfaction tables, and summarize key metrics by month.

Use the provided tables and include activities with a matching client. Satisfaction data may be missing. Report one row per segment and activity month.

Output

  1. Columns: segment, activity_month, activity_count, active_client_count, avg_duration_minutes, avg_satisfaction_score, satisfaction_response_pct, previous_month_activity_count, activity_change_pct
  2. Include the requested monthly segment metrics, ordered by segment, then activity_month.

Schema

clients
ColumnTypeDescription
client_idPKINTUnique client identifier
client_nameVARCHAR(100)Client organization name
segmentVARCHAR(30)Client segment
activities
ColumnTypeDescription
activity_idPKINTUnique activity identifier
client_idINTClient associated with the activity
activity_typeVARCHAR(40)Operational activity type
activity_atTIMESTAMPActivity timestamp
duration_minutesINTActivity duration in minutes
satisfactions
ColumnTypeDescription
satisfaction_idPKINTUnique satisfaction response identifier
activity_idINTActivity evaluated by the response
satisfaction_scoreINTSatisfaction rating from 1 to 5
response_channelVARCHAR(30)Channel used to submit feedback
Tablesclientsactivitiessatisfactions
Interviewer

Your question is SQL for Client Performance Insights. 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.