How does mysql, find out the number of people in a company and a department at a time?

as shown in the figure above, how to use the MySQL statement to find out the number of people in the company and each department at a time?

Mar.09,2021

 

find out at once? This can add a derivative column, but it doesn't make any sense. Do you want to see the proportion of people in each department?

check the number of departments (if you can't put quotation marks on the list name, the syntax should be correct):
SELECT department name, COUNT (*) number of departments
FROM table
GROUP BY department name

check the total number of people:
SELECT COUNT (*)
from table

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4c79f-43be0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4c79f-43be0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?