title: sql query to display dept name,location name,number of employees
body: <p>Here is my code:</p>
  
  <pre><code>SELECT dname,loc,avg(sal)
  FROM dept,emp
  GROUP BY loc;
  </code></pre>
  
  <p>I want to write a query to display the department name,location, and number of employees and the average salary for all the employees in that department. Label the columns dname,loc,number of employees and Avgsalary.</p>
  
  <p>The data is:</p>
  
  <pre><code>DNAME          LOC           Number of People     Salary                        
  -------------- ------------- ---------------- ----------                        
  SALES          CHICAGO                      6    1566.67                        
  RESEARCH       DALLAS                       5       2175                        
  ACCOUNTING     NEW YORK                     3    2916.67              
  </code></pre>