您的位置:首页 > 其它

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

2016-02-29 16:55 363 查看
56.View the Exhibit and examine the structure of the PROMOTIONS table.

Using the PROMOTIONS table, you need to find out the names and cost of all the promos done on 'TV'

and 'internet' that ended in the time interval 15th March '00 to 15th October '00.

Which two queries would give the required result? (Choose two.)



A.SELECT promo_name, promo_cost FROM promotions

WHERE promo_category IN ('TV', 'internet') AND

promo_end_date BETWEEN '15-MAR-00' AND '15-OCT-00';

B.SELECT promo_name, promo_cost FROM promotions

WHERE promo_category = 'TV' OR promo_category ='internet' AND promo_end_date >='15-MAR-00' OR promo_end_date <='15-OCT-00';

C.SELECT promo_name, promo_cost FROM promotions

WHERE (promo_category BETWEEN 'TV' AND 'internet') AND (promo_end_date IN ('15-MAR-00','15-OCT-00'));

D.SELECT promo_name, promo_cost FROM promotions

WHERE (promo_category = 'TV' OR promo_category ='internet') AND

(promo_end_date >='15-MAR-00' AND promo_end_date <='15-OCT-00');

答案:AD

解析:B选项or两边应该加括号,and的优先级高于or,因此不加括号会有问题,

C选项promo_category BETWEEN 'TV' AND 'internet'应该是走了T和i的ascii比如下面的

SQL> select 1 from dual where 'UAASDFADFSADF' between 'TV' and 'integer';

1

----------

1

因此选BC
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: