OCP-1Z0-051-V9.02-129题

129. 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 irrespectiveof 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.

Answer: C

答案解析:

参考:http://blog.csdn.net/rlhua/article/details/12877591

此处是右连接promotions ,即显示所有promotions 表中的信息,不管sales 表中promo_id 是否有。

原文地址:https://www.cnblogs.com/hzcya1995/p/13316862.html