Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Question 36 of 66
Free Preview · 66 of 220 · questions 1–66 of 220 are free. Sign up free to sync your progress across devices.
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
- Correct answer : A — Rows sort ascending by category first, then within each category tie sort descending by price, since ORDER BY accepts SELECT-list positions per key A . Correct: ORDER BY supports referencing SELECT-list columns by their integer position, so 2 refers to category and 3 refers to price; each key sorts independently unless a shared direction is stated, so category sorts ascending by default while price sorts descending as explicitly marked. B . Incorrect: Databricks SQL explicitly supports ordering by column position as an alternative to naming the column or alias directly, so this query parses and runs successfully. C . Incorrect: a DESC keyword only applies to the sort key it immediately follows; it does not retroactively apply to earlier keys in the same ORDER BY list, so category still sorts ascending here. D . Incorrect: positional references are fully honored by ORDER BY rather than ignored, and product_id is never used as a sort key in this query since it was not referenced by position or name.