Joins & Group By: Best Department

Which Department is the best to work for?

SQL>  select dname,avg(sal) from emp, dept 
      where emp.deptno = dept.deptno group by dname;

DNAME		 AVG(SAL)
-------------- ----------
ACCOUNTING     2916.66667
RESEARCH	     2175
SALES		     1310
Accounting... OF COURSE!!!

Bob Dugan bdugan@stonehill.edu