Which departments remain after LEFT JOIN and WHERE?

The query joins employees to departments, filters departments by d.id, and counts the employees in each department. Which rows will appear in the result?

Predict the resultQuery execution orderJuniorAnalystBackendQA
Input data · iv_employees
idnamedepartment_idmanager_idsalaryhired_at
1Anna1NULL5000.002020-03-01 09:00:00
2Boris115000.002021-06-15 09:00:00
3Clara114000.002022-01-31 23:59:00
4Dmitry216000.002019-09-01 09:00:00
5Elena245500.002021-02-01 00:00:00
6Foma245500.002023-04-10 10:30:00
7Galina314500.002020-11-20 09:00:00
8HugoNULL13000.002024-05-05 09:00:00
9Irina37NULL2024-08-12 09:00:00
10Egor243500.002025-01-13 09:00:00
Input data · iv_departments
idname
1Sales
2Engineering
3Analytics
4Legal

Query

SELECT d.id,
       d.name,
       COUNT(e.department_id) AS staff
FROM iv_departments AS d
LEFT JOIN iv_employees AS e
  ON e.department_id = d.id
WHERE d.id >= 3
GROUP BY d.id, d.name
ORDER BY d.id