Which two SQL statements would execute successfully?

View the Exhibit and examine the structure of the PROMOTIONS table.
Which two SQL statements would execute successfully? (Choose two.)

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

Which two SQL statements would execute successfully? (Choose two.)

A.
UPDATE promotions
SET promo_cost = promo_cost+ 100
WHERE TO_CHAR(promo_end_date, ‘yyyy’) > ‘2000’;

B.
SELECT promo_begin_date
FROM promotions
WHERE TO_CHAR(promo_begin_date,’mon dd yy’)=’jul 01 98′;

C.
UPDATE promotions
SET promo_cost = promo_cost+ 100
WHERE promo_end_date > TO_DATE(SUBSTR(’01-JAN-2000′,8));

D.
SELECT TO_CHAR(promo_begin_date,’dd/month’)
FROM promotions
WHERE promo_begin_date IN (TO_DATE(‘JUN 01 98’), TO_DATE(‘JUL 01 98’));



Leave a Reply 6

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


sonam

sonam

Why D is incorrect?

noel

noel

because the to_date functions in the where clause needed a mask to work
like to_date(‘JUN 01 98′,’MON DD YY’)

Emily

Emily

because there is no format model on to date function

Alvin2201

Alvin2201

A. and B. surely work
D. can work if the NLS Format is set to ‘MON DD YYYY’
In my case:
select promo_begin_date
FROM promotions
WHERE promo_begin_date in (TO_DATE(’10-AGO-2000′), TO_DATE(’23-AGO-2000′)) ;
WORKS

davor

davor

C would work if it was written like this: TO_DATE(SUBSTR(’01-JAN-2000′,8), ‘YYYY’).