QuestionQ19

VerifiedRestricting and Sorting Data

Examine the description of the MEMBERS table:

Question Image

Examine this partial query:

SELECT city, last_name LNAME FROM members ...;  

You want to display every city that contains the string an. Return the cities in ascending order, with the last names additionally sorted in descending order.

Which two clauses must be added to the query?

Choose two
Explanation

The LIKE '%AN%' condition matches character values containing AN anywhere in the city name. ORDER BY 1, LNAME DESC sorts by the first selected expression (city) in the default ascending order and then sorts the LNAME alias in descending order within each city. Oracle permits ordering by select-list position and alias.

Learn more

Community Discussion

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