Which SQL statements are valid?

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

Which SQL statements are valid? (Choose all that apply.)

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

Which SQL statements are valid? (Choose all that apply.)

A.
SELECT promo_id. DECODE(NVL(promo_cost.O).promo_cost * 0.25. 100) “Discount”
FROM promotions;

B.
SELECT promo id. DECODE(promo_cost. 10000.
DECODE(promo_category. ‘Gl\ promo_cost * 25. NULL). NULL) “Catcost” FROM promotions;

C.
SELECT promo_id. DECODE(NULLIF(promo_cost. 10000). NULL. promo_cost*.25, *N/A’)
“Catcost”
FROM promotions;

D.
SELECT promo_id. DECODE(promo_cost. >10000. ‘High’. <10000. ‘Low’) “Range”FROM
promotions;

Explanation:
Note: there are some syntax issues in this question.



Leave a Reply 3

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


daroldrudolph

daroldrudolph

How can any of them work with Periods instead of commas?

Sagar

Sagar

Please update the options as below:

A. SELECT promo_id, DECODE(NVL(promo_cost,0), promo_cost, promo_cost * 0.25, 100) “Discount”
FROM promotions;

B. SELECT promo_id, DECODE(promo_cost, 10000, DECODE(promo_category, ‘G1’, promo_cost *.25, NULL), NULL) “Catcost”
FROM promotions;

C. SELECT promo_id, DECODE(NULLIF(promo_cost, 10000), NULL, promo_cost*.25, ‘N/A’) “Catcost”
FROM promotions;

D. SELECT promo_id, DECODE(promo_cost, >10000, ‘High’, <10000, 'Low') "Range"
FROM promotions;

There are a lot of syntactical errors in the given question.