输入banner图图片脚本导航/分类

常见的数据库对象

create view to scott
create or replace view empinfoview
as
select e.empno,e.ename,e.sa,e.sal*12 annsal,d.dname
from emp e,dept d
where e.deptno=d.deptno
with read only;

查询:
    select * from empinfoview
类似下面
    select e.empno,e.ename,e.sa,e.sal*12 annsal,d.dname
    from emp e,dept d
    where e.deptno=d.deptno

所简化查询,但是不能够提高性能
通过操作视图来对表进行修改
create
view view10 as select * from emp where deptno=10 with check option //通过这个视图只能操作看得到的数据 insert into view10 value(********,10) 可以 insert into view10 value(********,20) 不可以

   不建议通过视图来对表进行修改。

-----物化视图,可以缓存数据。

 

常见的数据库对象

标签: