hi friends please answer this question ASAP:-
how to count the no. of employee in a each department
or
no. of employee in each location by using emp/dept table

Answer Posted / ramandeep singh

SELECT Dept_Name, dept.Dept_ID, COUNT(*) AS 'no. of
employees' FROM dept
LEFT JOIN emp ON emp.Dept_ID = dept.Dept_ID
GROUP BY dept.Dept_ID, Dept_Name

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the properties of subqueries in sql server?

627


How do I find the query plan in sql server?

623


Can we perform backup restore operation on tempdb? : sql server database administration

669


What is the difference between writing data to mirrored drives versus raid5 drives

578


Which language rdl files made of?

104






What are audit control procedures?

668


What is the rdl file?

96


Explain the creation and execution of a user-defined function in the sql server?

680


What is sharding?

96


Can two different columns be merged into single column? Show practically?

692


what is the difference between a primary key and a unique key? : Sql server database administration

626


The external application that is executed in one of the tasks does not have a log file, but only a screen log. How can I save the data from the screen? : sql server management studio

604


What is difference between views and tables?

556


What is difference between inner join and full join?

662


IF more than one Site is accessing the same Database server and I want to move the DB with Minimum down time? How will you do

1419