Web学习笔记 - 第007天

2017-02-13  本文已影响0人  迷茫o

昨日作业

select ename, job, sal from tb_emp
where sal=(select max(sal) from tb_emp
where mgr is not null);
select ename, sal from tb_emp
where sal>(select avg(sal) from tb_emp);
select ename, sal, avgSal from
(select dno, avg(sal) as avgSal from tb_emp group by dno) as t1, 
tb_emp as t2 
where t1.dno=t2.dno and t2.sal>t1.avgSal;
select t1.dno, ename, sal, avgSal from tb_emp as t1,
(select dno, avg(sal) as avgSal from tb_emp
group by dno having avgsal>=2500) as t2
where t1.dno=t2.dno and sal>avgSal;
select dname, ename, sal from
(select t1.dno, ename, sal
(select dno, max(sal) as maxSal from tb_emp 
group by dno) as t1, tb_emp as t2
where t1.dno=t2.dno and sal=max(sal)) as t3,
tb_dept as t4 where t3.dno=t4.dno;
select dname, ename, sal from
(select t1.dno, ename, sal from
(select dno, max(sal) as maxSal from tb_emp 
group by dno) as t1 inner join tb_emp as t2
on t1.dno=t2.dno and sal=maxSal) as t3
inner join tb_dept as t4 on t3.dno=t4.dno;
select dname, total from
(select dno, count(dno) as total from tb_emp
group by dno) as t1 inner join tb_dept as t2
on t1.dno=t2.dno;
select dname as 部门名称, ifnull(total, 0) as 总人数 from
(select dno, count(dno) as total from tb_emp
group by dno) as t1 right join tb_dept as t2
on t1.dno=t2.dno;
select ename from tb_emp
where eno in (
select distinct mgr from tb_emp 
where mgr is not null);

杂项

产品经理/UI/UE

--- 界面原型
Axure RP / Sketch / Briefs / mockups

UML

--- ROSE / StarUML / EA(Enterprise Architect)

数据库设计

--- ER图 PowerDesigner

上一篇下一篇

猜你喜欢

热点阅读