ITPub博客

首页 > 数据库 > Oracle > OCP 1Z0-051-99

OCP 1Z0-051-99

原创 Oracle 作者:LuiseDalian 时间:2014-05-19 07:01:03 0 删除 编辑
(99)View the Exhibit and examine the structure of the PROMOTIONS table.

Using the PROMOTIONS table, you need to find out the average cost for all promos in the ranges $0-2000 and $2000-5000 in category A.

You issue the following SQL statement:

SELECT AVG(CASE WHEN promo_cost BETWEEN 0 AND 2000 AND promo_category='A' then promo_cost ELSE null END) "CAT_2000A",

        AVG(CASE WHEN promo_cost BETWEEN 2001 AND 5000 AND promo_category='A' THEN promo_cost ELSE null END) "CAT_5000A"

FROM promotions;

What would be the outcome?


A. It executes successfully and gives the required result.

B. It generates an error because NULL cannot be specified as a return value.

C. It generates an error because CASE cannot be used with group functions.

D. It generates an error because multiple conditions cannot be specified for the WHEN clause.

答案:(A)

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1163932/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: OCP 1Z0-051-97
请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    6042709