Computer Science

List the count of employees grouped by deptno. (table EMPL)

SQL Joins & Grouping

1 Like

Answer

SELECT deptno, COUNT(*) AS employee_count
FROM EMPL
GROUP BY deptno;
Output
+--------+----------------+
| deptno | employee_count |
+--------+----------------+
|     20 |              5 |
|     30 |              6 |
|     10 |              3 |
+--------+----------------+

Answered By

1 Like


Related Questions