首页 > 其他 > 详细

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

时间:2014-06-26 15:36:41      阅读:385      评论:0      收藏:0      [点我收藏+]

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

bubuko.com,布布扣

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题,布布扣,bubuko.com

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

原文:http://www.cnblogs.com/wjx515/p/3809054.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!