View the Exhibit and examine the structure of the promotions table.
Evaluate the following SQL statement:
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.
Explanation:
A
This question is completely absurd. “It shows COST_REMARK for all the promos in the table”. Does this means the string COST_REMARK will be in each line of the query? Nonsense.
Does it means that all sigle lines of the table will be returned and the column COST_REMARK will have a value for everyone? A really stupid way of thinking/explaining something.
I really don’t understand this site…
This is how vendors like Oracle present their questions though. You really need to be good at guessing what they want, as well as having an excellent understanding of the topic material. Trick questions and vague wording is how they make multiple choice difficult. In this case, they mean “it shows a COST_REMARK result for each column”. Since COST_REMARK is the alias for the CASE expression, they are referring to the result of the CASE expression for every row.
Yes, the A is the right answers.
CASE returns string ‘HIGH’ for records, where promo_costs >= average costs in TV group and return ‘LOW’ in other cases.