Which statement is true regarding the outcome of the above query?

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

Evaluate the following SQL statement:
SQL>SELECT promo_name,CASE
WHEN promo_cost >=(SELECT AVG(promo_cost)
FROM promotions
WHERE promo_category=’TV’)
then ‘HIGH’
else ‘LOW’
END COST_REMARK
FROM promotions;
Which statement is true regarding the outcome of the above query?

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

Evaluate the following SQL statement:
SQL>SELECT promo_name,CASE
WHEN promo_cost >=(SELECT AVG(promo_cost)
FROM promotions
WHERE promo_category=’TV’)
then ‘HIGH’
else ‘LOW’
END COST_REMARK
FROM promotions;
Which statement is true regarding the outcome of the above query?

A.
It shows COST_REMARK for all the promos in the table.

B.
It produces an error because the subquery gives an error.

C.
It shows COST_REMARK for all the promos in the promo category ‘TV’.

D.
It produces an error because subqueries cannot be used with the CASE expression.



Leave a Reply 3

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


Jason

Jason

what’s the ‘then else’ point to ?

Guess

Guess

Review the syntax of Case expression:
Case [exp]?
[when …. then ….]+
[else …]?
End

hwfurlan

hwfurlan

COST_REMARK depending on result of CASE output.