Question 1 · 238 in bank
Select 2Examine the description of the PROMOTIONS table:
You want to display the unique promotion costs in each promotion category. Which two queries can be used? (Choose two.)
Show answer
Answer: AC
Explanation
-- Distinct keyword is used to select the unique values of the column/combination of columns mentioned after the DISTINCT clause. Thus Option E is incorrect , as this does not use DISTINCT clause and might include duplicates. -- Distinct should be used once in a SELECT statement and should be used IMMEDIATELY after the SELECT clause. NOT to be used before every column. Thus Options D and B are incorrect, as the positioning of the DISTINCT clause is incorrect. -- Option A and C are correct. Option A: Even though there is a string ' has ' in everyrow returned , the combination of promo_category || ' has ' || promo_cost will still be distinct. Option C: correct use case. ORDER BY clause does not affect the uniqueness in the returned result set.
Source: Adapted from community discussion — Oracle_373