Departments with 100+ Employees

Given schema:

  • Emp(eid, ename, age, salary)
  • Works(eid, did, pct_time)
  • Dept(did, dname, budget, managerid)

Find departments with more than 100 employees. Complete the query:

SELECT did, COUNT(DISTINCT eid) as num_employees
FROM _____
GROUP BY did
HAVING COUNT(DISTINCT eid) > 100;