What are the department ids for departments which have more than 2 employees?
select department_id from employees group by department_id having count(*) >= 2
What is the sum of the salaries within each of those departments?
select department_id, sum(salary) from employees group by department_id having count(*) >= 2