Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Single-Line SQL: Retrieve Employee Names
00:00
5 left

Single-Line SQL: Retrieve Employee Names

EasySQL · PostgreSQL

Problem

Phenom needs a simple employee directory query for its internal Employee Experience platform. Write a single-line PostgreSQL query that retrieves the name of every employee from the employee table.

Requirements

  1. Return one column containing all employee names.
  2. Sort the names alphabetically so the output is deterministic.
  3. Do not filter employees by department or employment status.

Schema

employee
ColumnTypeDescription
employee_idPKINTEGERUnique employee identifier
employee_nameVARCHAR(100)Employee's full name
departmentVARCHAR(80)Employee's department, if assigned
employment_statusVARCHAR(30)Current employment status
work_emailVARCHAR(150)Employee's work email address
Tablesemployee
Interviewer

Your question is Single-Line SQL: Retrieve Employee Names. Start with the requirements and the one table 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.