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');
Answer: AD
答案解析:
题意要求done on 'TV'and 'internet'
that ended in the time interval 15th March '00 to 15th October '00.
B错误,promo_end_date >='15-MAR-00' OR promo_end_date
<='15-OCT-00' 应使用AND
C错误,promo_category BETWEEN 'TV' AND 'internet',条件不满足。

本文将展示如何利用SQL查询技术,在特定的时间区间内筛选出指定类别的促销活动,具体涉及到对Promotion表格中促销类别为'电视'和'互联网'的活动,在15年3月15日至10月15日之间进行筛选。通过对比四个选项,解答如何正确构造SQL查询语句以获取所需结果。

3985

被折叠的 条评论
为什么被折叠?



