Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Distinct departments

SQL data engineering interview problem. Difficulty: beginner. Pattern: Deduplication. About 8 minutes. Free to practice.

Return distinct non-null department values from employees. Column: department. Order by department.

Constraints

  • Return exactly these columns: department.

Examples

Input: employees name | department Alice Chen | Engineering Bob Kumar | Engineering Omar Ali | Sales Max Reed | Sales Output: department | Engineering | Sales | Why this passes: DISTINCT collapses repeats. Marketing exists in departments but has no employee rows here.

Topics: lakebench, sql, distinct.

More SQL interview questions · All interview problems · Learn data engineering

beginner

Distinct departments

Interview-style drill: List unique department names.

Return distinct non-null `department` values from `employees`. Column: `department`. Order by `department`.