QuestionQ124

VerifiedRestricting and Sorting Data

Refer to the exhibit and review the structure of the CUSTOMERS table.

Question Image

You must produce a report from the customers table that displays customer details, sorted by city in descending order and, within each city, by income level in descending order. Which query accomplishes this task?

Question Image

Explanation

An ORDER BY clause evaluates sort keys from left to right. Listing cust_city DESC first groups and orders cities from highest to lowest; listing cust_income_level DESC second orders customers by income level from highest to lowest within each city. Oracle allows a direction to be specified for each individual sort expression.

Learn more

Community Discussion

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