Thursday, May 9, 2019

SQL Server : Count no. of employees in each department

Count no. of employees in each department

SELECT DEPT_NAME,COUNT(EMP_ID)
FROM DEPARTMENT D LEFT JOIN EMPLOYEE E ON D.DEPT_ID=E.DEPARTMENT_ID
GROUP BY DEPT_NAME


No comments:

Post a Comment

C# Record type: Something to remember while using record types

  Record in c# provide a concise and expressive way to create immutable data types, record is a keyword in c#, we can use this keyword with ...