Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Integrate Workforce Data with HR System

MediumSQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Integrate Workforce Data with HR System. Read through the requirements and the two tables first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

You need to log in / sign up to run or submit.

Problem

A company is integrating a new workforce planning platform with its existing HR system. Write a SQL query to ensure data accuracy by identifying discrepancies in employee records between the two systems.

Requirements

  1. Join the employees table from the HR system with the workforce_planning table using employee_id.
  2. Identify employees that exist in the HR system but are missing from the workforce planning platform.
  3. Include a flag to indicate if the employee is active in the HR system.
  4. Return only those employees with discrepancies in their records.

Schema

employees
ColumnTypeDescription
employee_idPKINTUnique identifier for each employee
nameVARCHAR(255)Employee's name
activeBOOLEANIndicates if the employee is currently active
departmentVARCHAR(255)Department where the employee works
workforce_planning
ColumnTypeDescription
employee_idPKINTUnique identifier for each employee in workforce planning
nameVARCHAR(255)Employee's name as recorded in workforce planning
positionVARCHAR(255)Position of the employee in workforce planning
Tablesemployeesworkforce_planning
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results