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 4

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


Trinux

Trinux

Tricky question…

Pablo

Pablo

Can someone explain this please? Can’t figure it out. Is there something about having COST_REMARK at the END that overwrites the then and else clauses ?

saurabh

saurabh

A is the correct one.