1.列出在北京工作的职员的姓名。 
select ENAME from EMP where DEPTNO in (select DEPTNO from DEPT where LOC='北京') 2.找出部门经理为“张三” 的部门所有职员的姓名。(用连接查询)   select ENAME from EMP where MGR in (select EMPNO from EMP where ENAME='张三')
3.列出各部门的部门代号, 平均工资, 总工资。  select DEPTNO,avg(SAL) as 平均工资,sum(SAL) as 总工资 from EMP group by DEPTNO4.选出与“销售部”在同一地的部门名称。 select * from DEPT where DEPTNO in (select DEPTNO from DEPT group by DEPTNO having count(*)>1)5.列出职员人数超过10人的部门代号, 人数。  select DEPTNO,count(*) 人数  from EMP group by DEPTNO having count(*)>106.列出职员人数最多部门代号。  select top 1 DEPTNO,人数  from (select DEPTNO,count(*) as 人数  from EMP group by DEPTNO) tem order by 人数 desc7.列出各部门的名称及其经理的名字。 select  DNAME,(select max(MGR) from EMP where DEPTNO=a.DEPTNO) 经理名字 from DEPTNO as a--注:这个表就设计错了,经理应该在部门表里,max是可以对字符的
8.修改数据,将在‘北京’工作的职员的工资增加10%。update EMP set SAL=SAL+(SAL/10) where DEPTNO in (select DEPTNO from DEPT where LOC='北京')