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
SQL for Recent Hires
00:00
5 left

SQL for Recent Hires

EasySQL · PostgreSQL

Problem

Jones Lang LaSalle wants a current hiring report for employees who joined within the previous six months. Write a PostgreSQL query using each employee's hire_date, joining the employee record to its JLL office.

Assume the query runs on 2026-08-29. The six-month boundary is inclusive, so employees hired on 2026-02-28 should be included.

Requirements

  1. Return the employee ID, name, job title, hire date, office name, and city.
  2. Include only employees whose hire date is between the six-month boundary and the run date, inclusive.
  3. Exclude employees without a matching office record.
  4. Sort by most recent hire date first, then employee ID ascending.

Output

  1. One row per qualifying employee, with columns employee_id, full_name, job_title, hire_date, office_name, and city.
  2. Include only employees hired from 2026-02-28 through 2026-08-29, inclusive, with a matching office record. Rows with a NULL hire_date are excluded.
  3. Sort by hire_date descending, then employee_id ascending.

Schema

employees
ColumnTypeDescription
employee_idPKINTUnique employee identifier
full_nameVARCHAR(100)Employee's full name
job_titleVARCHAR(100)Employee's job title
hire_dateDATEDate the employee joined JLL
office_idINTReferences jll_offices.office_id
jll_offices
ColumnTypeDescription
office_idPKINTUnique JLL office identifier
office_nameVARCHAR(100)JLL office name
cityVARCHAR(80)City containing the office
Tablesemployeesjll_offices
Interviewer

Your question is SQL for Recent Hires. Start with the requirements and the two 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.