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
ExperiencesCoaching
New
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
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

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the two tables are in the Question tab.

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.