Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL for Recent Hires

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL for Recent Hires. Start with the requirements and the two tables on the right.

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.

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.

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
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results