首页 > 数据库 > Oracle > OCP 1Z0-051-38
A. A simple view in which column aliases have been used cannot be updated.
B. Rows cannot be deleted through a view if the view definition contains the DISTINCT keyword.
C. Rows added through a view are deleted from the table automatically when the view is dropped.
D. The OR REPLACE option is used to change the definition of an existing view without dropping and re-creating it.
E. The WITH CHECK OPTION constraint can be used in a view definition to restrict the columns displayed through the view.
答案:(B、D)
解析:
|
scott@TESTDB11>create or replace view v_emp10 as select empno as id, ename, sal, deptno from emp where deptno = 10; View created. scott@TESTDB11>select * from v_emp10;
scott@TESTDB11>update v_emp10 set sal = sal + 100 where id = 7782; 1 row updated. scott@TESTDB11>select * from v_emp10;
scott@TESTDB11>create view v_dept as select distinct deptno from emp; View created. scott@TESTDB11>select * from v_dept; DEPTNO ---------- 30 20 10 scott@TESTDB11>delete from v_dept where deptno = 10; delete from v_dept where deptno = 10 * ERROR at line 1: ORA-01732: data manipulation operation not legal on this view |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1158782/ ,如需转载,请注明出处,否则将追究法律责任。