OCP-1Z0-051-题目解析-第10题

Posted jzdwajue

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OCP-1Z0-051-题目解析-第10题相关的知识,希望对你有一定的参考价值。

10. View the Exhibit and examine the structure of the PROMOTIONS table.

Each promotion has a duration of at least seven days .
Your manager has asked you to generate a report, which provides the weekly cost for each promotion
done to l date.
Which query would achieve the required result?

 
A. SELECT promo_name, promo_cost/promo_end_date-promo_begin_date/7
FROM promotions;
B. SELECT promo_name,(promo_cost/promo_end_date-promo_begin_date)/7
FROM promotions;
C. SELECT promo_name, promo_cost/(promo_end_date-promo_begin_date/7)
FROM promotions;
D. SELECT promo_name, promo_cost/((promo_end_date-promo_begin_date)/7)
FROM promotions;


Answer: D

题目解析:

题目的意思:是求每一个促销在促销期间内。每周的的平均消费。

由给出的表可知:促销的总花费为 promo_cost 促销的时长为 (promo_end_date-promo_begin_date)。把促销时长转换为周须要除7为

 (promo_end_date-promo_begin_date)/7。所以每周的平均花费为promo_cost/( (promo_end_date-promo_begin_date)/7)

显然D是正确的,这题主要考察表达式的运算顺序,答案ABC在运行的时候都会提示语法错误。

以上是关于OCP-1Z0-051-题目解析-第10题的主要内容,如果未能解决你的问题,请参考以下文章

OCP-1Z0-051-题目解析-第9题

OCP-1Z0-051-题目解析-第11题

OCP-1Z0-051-题目解析-第50题

OCP-1Z0-051-题目解析-第27题

OCP-1Z0-051-题目解析-第1题

OCP-1Z0-051-题目解析-第16题