select avg(SALARY) as SALARY,DEPT.DNAME from EMP
left join DEPT on DEPT.DNO = EMP.DNO  where SALARY>=600 group by DEPT.DNAME update EMP set SALARY = SALARY * 1.1 where SALARY<600 and DNO in (select DNO from DEPT where DNAME = N'销售部')