Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Join Employees and Departments

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

Your question is Join Employees and Departments. Start with the requirements and the one table 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

Hyundai Autoever America maintains an employee directory for internal software and operations reporting. Write a PostgreSQL query that returns each employee together with the department name stored in the directory.

Requirements

  1. Return the employee ID, employee name, job title, and department name.
  2. Include employees whose department name is currently unknown, and sort the results by employee ID in ascending order.

Schema

employee_directory
ColumnTypeDescription
employee_idPKINTUnique employee identifier
employee_nameVARCHAR(100)Employee's full name
job_titleVARCHAR(100)Current job title
department_nameVARCHAR(100)Assigned department name, when available
Tablesemployee_directory
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results