Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Departments with more than three people

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

Find departments with more than 3 employees. Return department and employee_count. Ignore NULL departments. Order by employee_count descending, then department.

Constraints

  • Return exactly these columns: department, employee_count.

Examples

Input: employees department | rows Engineering | 4 Sales | 2 Output: department | employee_count Engineering | 4 Why this passes: Sales has 2, which fails > 3. Only Engineering clears the bar.

Topics: lakebench, sql, having, group by.

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

beginner

Departments with more than three people

Interview-style drill: HAVING filter for departments larger than three employees.

Find departments with more than 3 employees. Return `department` and `employee_count`. Ignore NULL departments. Order by `employee_count` descending, then `department`.