Which two queries would give the required result?

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.)

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′);



Leave a Reply 10

Your email address will not be published. Required fields are marked *


banu

banu

How Option D is correct?
It has the option of TV or Internet ..but the requirement is to get both tv AND Internet

melese

melese

i agree with u.option D is never correct.

Justyna

Justyna

WHERE promo_category IN (‘TV’, ‘internet’)
is the same like
WHERE (promo_category = ‘TV’ OR promo_category =’internet’)

Promo_category cannot be at the same time ‘TV’and ‘internet’.

Anurag

Anurag

option a and b is correct

Nikhil

Nikhil

are you kidding me??
parenthesis is missing in b…so a and d are correct

Justyna

Justyna

B is not correct because paranthesis are missing.

Burp

Burp

B is wrong becaus of the OR between the date clauses. This way you would select dates which == as if you wouldn’t select any dates.

kabelo

kabelo

B is wrong because of the or in dates, not some much because of parentheses… Am i right?

farooq

farooq

I think the question should be read as promo category done on TV and Internet and not both tv AND Internet.

prince

prince

Option B is not correct because promo_end_date does not show time interval ie time range