OCP 1Z0 051 132
来源:互联网 发布:php调用微信支付接口 编辑:程序博客网 时间:2024/05/19 03:18
132. View the Exhibit and examine the structure of the SALES and PRODUCTS tables.
In the SALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTS table,
You want to list each product ID and the number of times it has been sold.
Evaluate the following query:
SQL>SELECT p.prod_id, COUNT(s.prod_id)
FROM products p _____________ sales s
ON p.prod_id = s.prod_id
GROUP BY p.prod_id;
Which two JOIN options can be used in the blank in the above query to get the required output? (Choose
two.)
A. JOIN
B. FULL OUTER JOIN
C. LEFT OUTER JOIN
D. RIGHT OUTER JOIN
因为SALES.PROD_ID 依赖于 PRODUCTS.PROD_ID
所以不存在 SALES.PROD_ID有值而PRODUCTS.PROD_ID没什的数据,相当于可以加条件 WHERE p.prod_id IS NOT NULL
所以full outer join 就相当于 products p left join sales s
我们可以通过plan观察
Answer: BC
In the SALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTS table,
You want to list each product ID and the number of times it has been sold.
Evaluate the following query:
SQL>SELECT p.prod_id, COUNT(s.prod_id)
FROM products p _____________ sales s
ON p.prod_id = s.prod_id
GROUP BY p.prod_id;
Which two JOIN options can be used in the blank in the above query to get the required output? (Choose
two.)
A. JOIN
B. FULL OUTER JOIN
C. LEFT OUTER JOIN
D. RIGHT OUTER JOIN
因为SALES.PROD_ID 依赖于 PRODUCTS.PROD_ID
所以不存在 SALES.PROD_ID有值而PRODUCTS.PROD_ID没什的数据,相当于可以加条件 WHERE p.prod_id IS NOT NULL
所以full outer join 就相当于 products p left join sales s
我们可以通过plan观察
SQL> EXPLAIN PLAN FOR SELECT * 2 FROM sh.products p 3 FULL OUTER JOIN sh.sales s 4 ON s.prod_id = p.prod_id 5 WHERE p.prod_id IS NOT NULL;ExplainedExecuted in 0.016 secondsSQL> select * from table(dbms_xplan.display);PLAN_TABLE_OUTPUT--------------------------------------------------------------------------------Plan hash value: 1313708566--------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time--------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 918K| 177M| 534 (3)| 00:00:07|* 1 | HASH JOIN OUTER | | 918K| 177M| 534 (3)| 00:00:07| 2 | TABLE ACCESS FULL | PRODUCTS | 72 | 12456 | 3 (0)| 00:00:01| 3 | PARTITION RANGE ALL| | 918K| 25M| 528 (2)| 00:00:07| 4 | TABLE ACCESS FULL | SALES | 918K| 25M| 528 (2)| 00:00:07--------------------------------------------------------------------------------Predicate Information (identified by operation id):--------------------------------------------------- 1 - access("S"."PROD_ID"(+)="P"."PROD_ID")16 rows selected注意这儿的条件:access("S"."PROD_ID"(+)="P"."PROD_ID")
Answer: BC
0 0
- OCP 1Z0 051 132
- OCP 1Z0 052 132
- OCP 1Z0 052 132
- OCP 1Z0 053 132
- OCP 1Z0 051 1
- OCP 1Z0 051 2
- OCP 1Z0 051 3
- OCP 1Z0 051 4
- OCP 1Z0 051 5
- OCP 1Z0 051 6
- OCP 1Z0 051 7
- OCP 1Z0 051 8
- OCP 1Z0 051 9
- OCP 1Z0 051 10
- OCP 1Z0 051 11
- OCP 1Z0 051 12
- OCP 1Z0 051 13
- OCP 1Z0 051 14
- Android CookieSyncManager同步cookie
- 搞ACM的你伤不起(转)
- 有选择的忽略PyCharm 3的PEP8语言风格警告提示信息
- JDBC的问题集(续--持续更新中)
- freemarker之include指令
- OCP 1Z0 051 132
- 打印十字图(蓝桥)
- Git使用过程遇到的问题
- hadoop-2.4.0 wordcount
- 比较好的书籍---计算机,信号处理等专业
- Shell常见变量
- 一笔画问题
- vlc播放264 rtp流媒体sdp文件及其参数介绍
- 使用状态模式(state pattern)替代if else