1.
查询部门
20
的员工,每个月的工资总和及平均工资。
Select
depnto,sum
(
sal
),avg(
sal
) from emp where
deptno
=
20 order by
deptno
2.
查询工作在
CHICAGO
的员工人数,最高工资及最低工资。
Select count(distinct
ename
),max(
sal
),min(
sal
) from
Emp
e,dept
d where
d.loc
=('CHICAGO') and
e.deptno
=
d.deptno
3.
查询员工表中一共有几种岗位类型。
Select
deptno,sum
(
sal
),avg(
sal
) from emp where
deptno
=
20
order by
deptno
Select
count(distinct
ename
),max(
sal
),min(
sal
) from
Emp
e,dept
d where
d.loc
=('CHICAGO') and
e.deptno
=
d.deptno
Select count(distinct job) from Emp
1.
查询部门
20
的员工,每个月的工资总和及平均工资。
Select
depnto,sum
(
sal
),avg(
sal
) from emp where
deptno
=
20 order by
deptno
2.
查询工作在
CHICAGO
的员工人数,最高工资及最低工资。
Select count(distinct
ename
),max(
sal
),min(
sal
) from
Emp
e,dept
d where
d.loc
=('CHICAGO') and
e.deptno
=
d.deptno
3.
查询员工表中一共有几种岗位类型。
Select
deptno,sum
(
sal
),avg(
sal
) from emp where
deptno
=
20
order by
deptno
Select
count(distinct
ename
),max(
sal
),min(
sal
) from
Emp
e,dept
d where
d.loc
=('CHICAGO') and
e.deptno
=
d.deptno
Select
count(distinct job) from Emp