Which SQL statement would you use?

View the Exhibit and examine the data in the PROMOTIONS table.
PROMO_BEGIN_DATE is stored in the default date format, dd-mon-rr.
You need to produce a report that provides the name, cost, and start date of all promos in the
POST category that were launched before January 1, 2000.
Which SQL statement would you use?

View the Exhibit and examine the data in the PROMOTIONS table.
PROMO_BEGIN_DATE is stored in the default date format, dd-mon-rr.
You need to produce a report that provides the name, cost, and start date of all promos in the
POST category that were launched before January 1, 2000.
Which SQL statement would you use?

A.
SELECT promo_name, promo_cost, promo_begin_date
FROM promotions
WHERE promo_category = ‘post’ AND promo_begin_date < ’01-01-00′;

B.
SELECT promo_name, promo_cost, promo_begin_date
FROM promotions
WHERE promo_cost LIKE ‘post%’ AND promo_begin_date < ’01-01-2000′;

C.
SELECT promo_name, promo_cost, promo_begin_date
FROM promotions
WHERE promo_category LIKE ‘P%’ AND promo_begin_date < ‘1-JANUARY-00’;

D.
SELECT promo_name, promo_cost, promo_begin_date
FROM promotions
WHERE promo_category LIKE ‘%post%’ AND promo_begin_date < ‘1-JAN-00’;



Leave a Reply 3

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


donald

donald

Answer C is correct. D is wrong because they ask for promos (promo_category) in the POST category. Selecting ‘%post%’ will return nothing because CASE matters. ‘post’ != ‘POST’

Mr. T

Mr. T

You name it – C is correct.

AndreaT

AndreaT

But in the “original” question there is a Exibit where the data of the table is shown, where category “post” is always written in lowercase.