Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Single-Line SQL: Retrieve Employee Names

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

Your question is Single-Line SQL: Retrieve Employee Names. 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

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
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results