Growth 🌳/Practice 💻

[해커랭크] Weather Observation Station 5

2022. 7. 28. 10:22

https://www.hackerrank.com/challenges/weather-observation-station-5/problem?isFullScreen=true 

 

Weather Observation Station 5 | HackerRank

Write a query to print the shortest and longest length city name along with the length of the city names.

www.hackerrank.com

 

SELECT CITY, LENGTH(CITY)       
 FROM STATION
 ORDER BY 2,1
 LIMIT 1;
SELECT CITY, LENGTH(CITY)       
 FROM STATION
 ORDER BY 2 DESC,1 ASC
 LIMIT 1