Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Integrate Workforce Data with HR System
00:00
5 left

Integrate Workforce Data with HR System

MediumSQL · PostgreSQL

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
Interviewer

Your question is Integrate Workforce Data with HR System. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.