PrepAway - Latest Free Exam Questions & Answers

What will be the result of the query if the following data is evaluated by the CASE expression?

Given the following query:
SELECT quantity,
CASE WHEN itemcode = ‘099’ THEN ‘SILVER’
WHEN itemcode = ‘788’ THEN ‘GOLD’
WHEN itemcode = ‘899’ THEN ‘PLATINUM’
ELSE ‘ERROR’
END
FROM supplier
What will be the result of the query if the following data is evaluated by the CASE expression?
SUPPLIER
——————————————
QUANTITY ITEMCODE
3 099
4 099
1 788
1 899
5 009
3 788
1 899

PrepAway - Latest Free Exam Questions & Answers

A.
3,SILVER
4,GOLD
1,SILVER
1,GOLD
5,PLATINUM
3,SILVER
1,GOLD

B.
3,SILVER
4,SILVER
1,GOLD
1,PLATINUM
5,ERROR
3,GOLD
1,PLATINUM

C.
3,SILVER
4,SILVER
1,PLATINUM
1,ERROR
5,SILVER
3,GOLD
1,PLATINUM

D.
3,SILVER
4,SILVER
1,GOLD
1,GOLD
5,SILVER
3,ERROR
1,PLATINUM


Leave a Reply