OCP-1Z0-051 第129题 RIGHT OUTER JOIN的使用
2014-05-17 12:16
543 查看
一、原题
View the Exhibits and examine the structures of the PROMOTIONS and SALES tables.
Evaluate the following SQL statement:
SQL>SELECT p.promo_id, p.promo_name, s.prod_id
FROM sales s RIGHT OUTER JOIN promotions p
ON (s.promo_id = p.promo_id);
Which statement is true regarding the output of the above query?
A. It gives the details of promos for which there have been sales.
B. It gives the details of promos for which there have been no sales.
C. It gives details of all promos irrespective of whether they have resulted in a sale or not.
D. It gives details of product ID s that have been sold irrespective of whether they had a promo or not.
答案:C
二、题目翻译
查看PROMOTIONS and SALES表的结构
评估下面的SQL语句
关于上面查询的输出哪句话是正确的?
A.输出已经销售的promos。
B.输出没有销售的promos。
C.不管有没有销售,输出所有的promos。
D.不管有没有promos,输出所有产品ID。
三、题目解析
因为使用的是RIGHT OUTER JOIN,所以会以右表promotions为准,输出所有的促销信息,不管有没有销售,没有的话,显示为空。
表连接的用法,详见:
http://blog.csdn.net/holly2008/article/details/25704471
View the Exhibits and examine the structures of the PROMOTIONS and SALES tables.
Evaluate the following SQL statement:
SQL>SELECT p.promo_id, p.promo_name, s.prod_id
FROM sales s RIGHT OUTER JOIN promotions p
ON (s.promo_id = p.promo_id);
Which statement is true regarding the output of the above query?
A. It gives the details of promos for which there have been sales.
B. It gives the details of promos for which there have been no sales.
C. It gives details of all promos irrespective of whether they have resulted in a sale or not.
D. It gives details of product ID s that have been sold irrespective of whether they had a promo or not.
答案:C
二、题目翻译
查看PROMOTIONS and SALES表的结构
评估下面的SQL语句
关于上面查询的输出哪句话是正确的?
A.输出已经销售的promos。
B.输出没有销售的promos。
C.不管有没有销售,输出所有的promos。
D.不管有没有promos,输出所有产品ID。
三、题目解析
因为使用的是RIGHT OUTER JOIN,所以会以右表promotions为准,输出所有的促销信息,不管有没有销售,没有的话,显示为空。
表连接的用法,详见:
http://blog.csdn.net/holly2008/article/details/25704471
相关文章推荐
- OCP-1Z0-051 第128题 LEFT OUTER JOIN,RIGHT OUTER JOIN的使用
- OCP-1Z0-051 第132题 LEFT OUTER JOIN,RIGHT OUTER JOIN,FULL OUTER JOIN的用法
- OCP-1Z0-051 第131题 LEFT OUTER JOIN和RIGHT OUTER JOIN的用法
- OCP-1Z0-051 第126题 LEFT OUTER JOIN,FULL OUTER JOIN,JOIN的使用
- OCP-1Z0-051 第130题 LEFT OUTER JOIN的用法
- OCP-1Z0-051 第106题 COALESCE,DECODE,NVL,NULLIF函数的使用
- OCP-1Z0-051 第101题 DECODE,COUNT,CASE WHEN,SUM的使用
- OCP-1Z0-051 第166题 使用子查询update表中的多列
- OCP-1Z0-051 第159题 insert语句中使用子查询
- OCP-1Z0-051 第83题 INSTR,SUBSTR,LPAD函数综合使用
- OCP-1Z0-051 第148题 子查询和ANY,ALL的使用
- OCP-1Z0-051 第165题 使用子查询update多列数据
- OCP-1Z0-051 第105题 NVL,DECODE,NULLIF,TRUNC,TO_CHAR函数使用
- OCP-1Z0-051 第110题 AVG的使用
- OCP-1Z0-051 第140题 子查询中使用GROUP BY注意事项
- OCP-1Z0-051 第22题 INTERVAL DAY TO SECOND的使用方法
- OCP-1Z0-051 第64题 order by使用别名注意事项
- OCP-1Z0-051 第124题 JOIN内连接
- OCP-1Z0-051 第125题 self-join(自连接)和self-join(子查询)
- OCP-1Z0-051 第160题 insert中使用子查询