QuestionQ32

VerifiedRestricting and sorting data

Review the description of the ORDER_ITEMS table:

Question Image

Review this incomplete query:

Question Image

Which two options can replace the placeholder so that the query completes successfully?

Choose two
Explanation

For a SELECT DISTINCT query, Oracle requires each ORDER BY expression to be included in the select list. The selected expression quantity * unit_price is valid for ordering, and total_paid is that expression’s select-list alias. The individual columns quantity, unit_price, and product_id are not selected expressions and cannot be used in the ORDER BY clause here.

Community Discussion

No comments yet. Be the first to start the discussion!