设为首页 加入收藏

TOP

ocp1Z0-051141-175题解析(四)
2014-11-24 08:04:39 来源: 作者: 【 】 浏览:6
Tags:ocp1Z0-051141-175 解析
me time interval.

Answer: D

解析:
GROUP BY (promo_end_datepromo_

begin_date)

表示以这个时间段分组

150. View the Exhibitand examine the data in the PROMOTIONS table.

You need to display allpromo categories that do not have 'discount' in their subcategory.

Which two SQL statementsgive the required result (Choose two.)

\

A. SELECTpromo_category

FROMpromotions

MINUS

SELECTpromo_category

FROMpromotions

WHEREpromo_subcategory = 'discount';

B. SELECTpromo_category

FROMpromotions

INTERSECT

SELECTpromo_category

FROMpromotions

WHEREpromo_subcategory = 'discount';

C. SELECTpromo_category

FROMpromotions

MINUS

SELECTpromo_category

FROMpromotions

WHEREpromo_subcategory <> 'discount';

D. SELECTpromo_category

FROMpromotions

INTERSECT

SELECTpromo_category

FROMpromotions

WHEREpromo_subcategory <> 'discount';

Answer: AD

解析:

MINUS,引用官方文档:

The following statementcombines results with the MINUS operator,

which returns onlyunique rows returned by the first query but not by the second:

INTERSECT

这个值要存在于第一句和第二句才会被选出,相当于两个查询的结果的交集

151. View the Exhibitand examine the structure of the CUSTOMERS and CUST_HISTORY tables.

The CUSTOMERS tablecontains the current location of all currently active customers. The

CUST_HISTORY tablestores historical details relating to any changes in the location of allcurrent as well

as previous customerswho are no longer active with the company.

You need to find thosecustomers who have never changed their address.

Which SET operator wouldyou use to get the required output

\

A. MINUS

B. UNION

C. INTERSECT

D. UNION ALL

Answer: A

解析:

题意:find thosecustomers who have never changed their address

所有的customers减去已经改变地址customers就等于没有改变地址的顾客

所以用运算符 minus,引用官方文档:

The followingstatement combines results with the MINUS operator,

which returnsonly unique rows returned by the first query but not by the second:

152. Which statement istrue regarding the UNION operator

A. By default, theoutput is not sorted.

B. NULL values are notignored during duplicate checking.

C. Names of all columnsmust be identical across all SELECT statements.

D. The number of columnsselected in all SELECT statements need not be the same.

Answer: B

解析:

引用官方文档:
UNION Example The following statement combines the results of two queries with

the UNION operator,which eliminates duplicate selected rows. This statement shows

that you must match datatype (using the TO_CHAR function) when columns do not

exist in one or theother table:

SELECT location_id,department_name "Department",

TO_CHAR(NULL)"Warehouse" FROM departments

UNION

SELECT location_id,TO_CHAR(NULL) "Department", warehouse_name

FROM warehouses;

LOCATION_ID DepartmentWarehouse

----------------------------------------- ---------------------------

1400 IT

1400 Southlake, Texas

1500 Shipping

1500 San Francisco

1600 New Jersey

153. View the Exhibitsand examine the structures of the PRODUCTS and SALES tables.

Which two SQL statementswould give the same output (Choose two.)

A. SELECT prod_id FROMproducts

INTERSECT

SELECT prod_id FROMsales;

B. SELECT prod_id FROMproducts

MINUS

SELECT prod_id FROMsales;

C. SELECT DISTINCTp.prod_id

FROM products pJOIN sales s

ONp.prod_id=s.prod_id;

D. SELECT DISTINCTp.prod_id

FROM products p JOINsales s

ON p.prod_id <>s.prod_id;

Answer: AC

解析:

INTERSECT

这个值要存在于第一句和第二句才会被选出,相当于两个查询的结果的交集

所以A选项的结果是

SELECT prod_id FROMproducts

SELECT prod

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 4/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇oracle报错 下一篇ORA-01078与LRM-00109报错解决

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C 内存管理 | 菜鸟教 (2025-12-26 20:20:37)
·如何在 C 语言函数中 (2025-12-26 20:20:34)
·国际音标 [ç] (2025-12-26 20:20:31)
·微服务 Spring Boot (2025-12-26 18:20:10)
·如何调整 Redis 内存 (2025-12-26 18:20:07)