码迷,mamicode.com
首页 > 其他好文 > 详细

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

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

标签:des   style   blog   http   color   com   

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题

标签:des   style   blog   http   color   com   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!