Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 feedbackSuccess 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
Managing the 'Everything' Dashboard Request
00:00
5 left

Managing the 'Everything' Dashboard Request

MediumSQL · PostgreSQL

Problem

How do you handle a request from a stakeholder who wants everything on one dashboard at The Johns Hopkins University?

For this exercise, write a SQL query that produces one dashboard-ready row for every department, including departments without activity records. Restrict activity metrics to January 2025.

Output

  1. One row per department with department_name, school_name, active_users, completed_requests, average_resolution_hours, monthly_target, and completion_rate
  2. Include departments with no matching activity or target data, using zero for count metrics and NULL where an average or rate cannot be calculated
  3. Order by school_name, then department_name

Schema

departments
ColumnTypeDescription
department_idPKINTUnique department identifier
department_nameVARCHAR(100)Department name
school_nameVARCHAR(100)School or division containing the department
dashboard_users
ColumnTypeDescription
user_idPKINTUnique dashboard user identifier
department_idINTDepartment associated with the user
user_statusVARCHAR(20)Current user status
dashboard_activity
ColumnTypeDescription
activity_idPKINTUnique activity identifier
user_idINTUser associated with the activity
activity_dateDATEDate of the activity
activity_statusVARCHAR(20)Status of the activity
resolution_hoursDECIMAL(8,2)Hours required to resolve a completed activity
dashboard_targets
ColumnTypeDescription
target_idPKINTUnique target record identifier
department_idINTDepartment associated with the target
monthly_targetINTTarget number of completed activities for the month
Tablesdepartmentsdashboard_usersdashboard_activitydashboard_targets
Interviewer

Your question is Managing the 'Everything' Dashboard Request. Start with the requirements and the four 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.