Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Operational Performance SQL Analysis
00:00
5 left

Operational Performance SQL Analysis

HardSQL · PostgreSQL

Problem

Write a SQL query to analyze operational performance by joining guest satisfaction, staffing, and occupancy data to identify the biggest drivers of service issues.

Use the three daily operational tables provided. Calculate service issue rates and compare staffing gaps with occupancy levels for operational days having complete, valid measurements.

Output

  1. One row per property and operational driver.
  2. Columns: property_id, driver_name, high_driver_issue_rate, low_driver_issue_rate, issue_rate_lift, and driver_rank.
  3. Include staffing-gap and occupancy-rate drivers, rank within each property by descending issue-rate lift, and break ties alphabetically by driver name.

Schema

guest_satisfaction_daily
ColumnTypeDescription
satisfaction_idPKINTDaily satisfaction record identifier
property_idVARCHAR(20)Property identifier
service_dateDATEOperational date
survey_countINTNumber of guest surveys received
issue_countINTSurveys reporting a service issue
staffing_daily
ColumnTypeDescription
staffing_idPKINTDaily staffing record identifier
property_idVARCHAR(20)Property identifier
service_dateDATEOperational date
scheduled_staffINTNumber of staff scheduled
actual_staffINTNumber of staff who worked
occupancy_daily
ColumnTypeDescription
occupancy_idPKINTDaily occupancy record identifier
property_idVARCHAR(20)Property identifier
service_dateDATEOperational date
rooms_availableINTRooms available for occupancy
rooms_occupiedINTRooms occupied
Tablesguest_satisfaction_dailystaffing_dailyoccupancy_daily
Interviewer

Your question is Operational Performance SQL Analysis. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.