Weather Observation Station 5

  • + 0 comments

    Please read the question carefully. Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest or largest city, choose the one that comes first when ordered alphabetically.

    As you can see, there is a condition in the question that tells "If there is more than one smallest or largest city, choose the one that comes first when ordered alphabetically". "length(city) asc and desc" will order the names as asc and desc. But if there is more than one smallest or largest, then we have to order the names according to the city names alphabetically. That's why I have used the "city asc" in both the cases. For limit please read the description that I have share before the query. Thank You.