Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL for Database Validation

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

Your question is SQL for Database Validation. 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

The ISS STOXX employee directory requires a basic data-quality check for short display names. Write a PostgreSQL query that returns employee records where employee_name contains exactly four letters.

Requirements

  1. Return the employee ID and employee name for matching records.
  2. Include only names consisting of exactly four alphabetic characters. Exclude shorter, longer, numeric, punctuation-containing, and NULL values.
  3. Sort the results alphabetically by employee name, then by employee ID.

Schema

employee
ColumnTypeDescription
employee_idPKINTEGERUnique employee identifier
employee_nameVARCHAR(100)Employee display name
Tablesemployee
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results