OCP 1Z0 051 42

来源:互联网 发布:办公隔断网络布线 编辑:程序博客网 时间:2024/05/27 09:48
42. Which three statements are true regarding views? (Choose three.) 
A. Views can be created only from tables. 
B. Views can be created from tables or other views. 
C. Only simple views can use indexes existing on the underlying tables. 
D. Both simple and complex views can use indexes existing on the underlying tables. 
E. Complex views can be created only on multiple tables that exist in the same schema. 
F. Complex views can be created on multiple tables that exist in the same or different schemas. 

SQL> create or replace view v_emp as select * from emp;View createdSQL> create or replace view v_emp2 as select empno,ename from emp;View created
b对。a不对

SQL> create or replace view v as select e.department_id,e.job_id,sum(e.salary) as sum_sal from employees e group by e.department_id,e.job_id;View createdSQL> create index idx_department_id on employees(department_id);Index createdSQL> explain plan for select * from v where department_id = 10;ExplainedSQL> select * from table(dbms_xplan.display);PLAN_TABLE_OUTPUT--------------------------------------------------------------------------------Plan hash value: 501232408--------------------------------------------------------------------------------| Id  | Operation                    | Name              | Rows  | Bytes | Cost--------------------------------------------------------------------------------|   0 | SELECT STATEMENT             |                   |     1 |    38 |     3|   1 |  HASH GROUP BY               |                   |     1 |    38 |     3|   2 |   TABLE ACCESS BY INDEX ROWID| EMPLOYEES         |     1 |    38 |     2|*  3 |    INDEX RANGE SCAN          | IDX_DEPARTMENT_ID |     1 |       |     1--------------------------------------------------------------------------------Predicate Information (identified by operation id):---------------------------------------------------   3 - access("E"."DEPARTMENT_ID"=10)Note-----   - dynamic sampling used for this statement (level=2)19 rows selected
d对 c不对

SQL> create or replace view v as select dept.deptno,sum(emp.sal) as sum_sal from test.dept inner join scott.emp on emp.deptno = dept.deptno group by dept.deptno;View created
f对 e不对

Answer: BDF
0 0
原创粉丝点击