We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This question is pretty clear it wants you to query for two cities, one with the longest name and one with the shortest name, and if there is a tie for either then use the city name that comes first alphabetically.
If you have to resort to guessing then there is an issue with the query methodology.
This query can be solved dynamically using MIN and Max, or even the ORDER BY clause with LIMIT.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 5
You are viewing a single comment's thread. Return to all comments →
This question is pretty clear it wants you to query for two cities, one with the longest name and one with the shortest name, and if there is a tie for either then use the city name that comes first alphabetically.
If you have to resort to guessing then there is an issue with the query methodology.
This query can be solved dynamically using MIN and Max, or even the ORDER BY clause with LIMIT.