美文网首页
Database Exercise 7 Data Manipul

Database Exercise 7 Data Manipul

作者: Drebin | 来源:发表于2018-10-26 11:23 被阅读0次
  • 9 Create a view for use by personnel in department 30 showing employee name, number, job and hiredate
create view runbin_7_9 as select ename, empno, job, hiredate from emp2016150071 where deptno = 30;
commit;
select * from runbin_7_9;
  • 10 Use the view to show employees in department 30 having jobs which are not salesman
select * from runbin_7_9 where job != 'SALESMAN';
  • 11 Create a view which shows summary information for each department.
create view runbin7_11 as
select deptno, count(distinct job) as TypesOfJob,count(deptno) as populations, avg(sal) as avgOfSal from emp2016150071 group by deptno;
select * from runbin7_11;
select * from emp2016150071;

相关文章

网友评论

      本文标题:Database Exercise 7 Data Manipul

      本文链接:https://www.haomeiwen.com/subject/agsktqtx.html