Search⌘ K

Solution to Exercise 3

Explore how to write SQL queries that count employees per project and sort results by that count. Understand using COUNT, GROUP BY, and ORDER BY clauses to manage data effectively with clear explanations and visualization.

We'll cover the following...

Solution

MySQL
SELECT PROJECT, COUNT(Emp_Id) AS Emp_Count
FROM SALARY
GROUP BY PROJECT
ORDER BY Emp_Count DESC;

Again, the solution will work without using the alias for COUNT(Emp_Id) ...