?????????????View????
??????1?????????????
??????2??????????????б???????? ??????????????Щ????????
??????3?????????????????????? SELECT ????????????????洢?????? SELECT ???
??????4????????????????????????????????
??????5???????д洢????????????????????????洢???????
??????6????????????????????????????????????????????
??????7??????????????0?????????
????????????????????
??????1??????????????????????????????');" target="_self">?????????????????????????Щ??????????????????????
??????2?????????????SQL????????д????????????????????????Ч??
??????????????
??????1?????У????????????????μ??????????????????????????
?????????????
??????1?????????????
??????2??????????
??????3???????????????
??????4?????????????????в??????????
????????emp???????У????????emp_view_1??create view ????? as select???????????????
????create view emp_view_1
????as
????select * from emp;
???????????£???????????????????????sysdba??????creare view?????
??????sysdba???????scott???create view???
????grant create view to scott;
??????sysdba????????scott???create view???
????revoke create view from scott;
????????emp??????У????????emp_view_2??????????????/????/????/??н/???????????????б?????
????create view emp_view_2
????as
????select empno "???"??ename "????"??sal "????"??sal*12 "??н"??sal*12+NVL(comm??0) "??????"
????from emp;
????????emp??????У????????emp_view_3(a??b??c??d??e)?????????/????/????/??н/????????????????????
????create view emp_view_3(a??b??c??d??e)
????as
????select empno "???"??ename "????"??sal "????"??sal*12 "??н"??sal*12+NVL(comm??0) "??????"
????from emp;
???????emp_view_3??????????
????desc emp_view_3;
???????emp_view_3(id??name??salary??annual??income)?????create or replace view ????? as ????
????create or replace view emp_view_3(id??name??salary??annual??income)
????as
????select empno "???"??ename "????"??sal "????"??sal*12 "??н"??sal*12+NVL(comm??0) "??????"
????from emp;
???????emp???????????????????????????????
????select min(sal)??max(sal)??round(avg(sal)??0)??deptno
????from emp
????group by deptno;
???????????emp_view_4??????а????????????????????????????
????create or replace view emp_view_4
????as
????select deptno "?????"??min(sal) "?????"??max(sal) "?????"??round(avg(sal)??0) "???????"
????from emp
????group by deptno;
???????????emp_view_5??????а???????????????????????????????????
????create or replace view emp_view_5
????as
????select e.empno "???"??e.ename "????"??e.sal "????"??d.dname "??????"??s.grade "??????"
????from emp e??dept d??salgrade s
????where (e.deptno=d.deptno) and (e.sal between s.losal and s.hisal);
??????????emp_view_1?е?7788??????????????delete????????????????
????delete from emp_view_1 where empno=7788;д???????????????
???????emp_view_1?????????with read only?????????????delete????????????
????create or replace view emp_view_1
????as
????select * from emp
????with read only;
???????????delete??????
???????????е????????????????????
????????????
??????????????????????????????
??????????????
???????????????????????
???????????????
????????????????????
????????????
??????????????????????
??????????????????????
????????
??????????????Index??
??????1????????????????????????????????????????
??????2??????????????/Щ?????????洢?????????????
??????????????
??????1???????????Oracle?????????????
??????2?????rowid?????λ?????????????????I/O
????rowid??oracle????????????????????
????rowid?????
??????1??λ????????У???????????????????磺desc emp?????????
??????2???????select?У????д??rowid?????????
??????3???????????????????????????rowid?????????rownum???????????rowid???????
??????4??rowid??18λ??Сд??????????壬????????????DBF????е?λ??
??????5??rowid???????=/like????????''???????rowid??????????????????Сд
??????6??rowid?????????DBF?????????
?????????????
??????1??????????????? Oracle?????????????????????? ??????Oracle????????????????????
??????2???????????????????????????????
??????3???????primary key??unique????????????????????????????
??????4?????????????????????????????λ?????Σ????????
????????????????????
??????1??????????? SELECT ????
??????2??????(???????)?????????????Χ???
??????3???????????? WHERE ?????????????г???
????????????????????????????????????????????????????????????????????????
??????????????????????
??????1??????????? INSERT/UPDATE/DELETE ????
??????2?????С(???????)
??????3?????????????????????????????? WHERE ?????
??????????
?????emp???empno??????Σ?????????emp_empno_idx???е?????????create index ?????? on ????(??Σ?...)
????create index emp_empno_idx
????on emp(empno);
?????emp???ename??job?????Σ?????????emp_ename_job_idx??????????/????????
????create index emp_ename_job
????on emp(ename??job);
?????????where???????job?????????
?????????where???????ename???????
????????????????ename??job
???????????????????в?????й??????????insert/update/delete????????????????
???????emp_empno_idx??emp_ename_job_idx??????drop index ??????
????drop index emp_empno_idx;
????drop index emp_ename_job_idx;