Use HAVING for group filter

SQL Easy 4 views
Back to Questions

Problem Description

From Employees and Departments, show only those departments where employee count is more than 5. Display dept_name and the count.

Input Format

SQL query

Output Format

Result set

Sample Test Case

Input:
Employees(dept_id), Departments(dept_id, dept_name)
Output:
Dept list

Constraints

Think: HAVING is for filtering groups, not rows

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next