How to aggregate data in sql?

clipboard.png
in the above table, if you want to find out the number of people in each department, what should you do? ask for divine guidance!
the result is like this:
number of employees in the department
Technical Department 23
Logistics 10

Sql
Mar.18,2021

use the group by statement:

select departmentName, count(*)
from tableName
group by departmentName;
Menu