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

來源:互聯網
上載者:User

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在執行的時候都會提示法錯誤。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.