~/ learn/ comp-378/ cards/ GROUP BY & HAVING: Per-Category Aggregates
1 of 5

For each manager who leads at least one project, show their employee id and how many projects they lead.

For each manager who leads at least one project, show their employee id and how many projects they lead.

Answer

SELECT lead_emp_id, COUNT(*) AS projects_led FROM projects GROUP BY lead_emp_id

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/a94947f0-d132-45dc-b5b3-be4502240028/flashcard utf-8 LF