QuestionQ230

VerifiedRestricting and sorting data

Review the definition of the MEMBERS table:

Question Image

Review the partial query:

SELECT city, last_name AS lname FROM members ...;  

You want to display every city containing 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

LIKE '%AN%' matches character values that contain AN anywhere in the city name. ORDER BY 1, lname DESC sorts by the first selected expression (city) in ascending order by default, then sorts the lname alias in descending order.

Community Discussion

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