목록코딩테스트/hackerrank (2)
GULGUL CODING

You are given a table, Functions, containing two columns: X and Y. Write a query to output all such symmetric pairs in ascending order by the value of X. List the rows such that X1 ≤ Y1. SELECT DISTINCT f1.x, f1.y FROM functions f1 INNER JOIN functions f2 ON f1.rowid f2.rowid AND f1.x = f2.y AND f1.y = f2.x AND f1.x
코딩테스트/hackerrank
2023. 7. 23. 20:50

Weather Observation Station 5 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. 정답) SELECT city ,length FROM (SELECT city ,LENGTH(city) length ,ROW_NUMBER() OVER(ORDER BY LENGTH(city)..
코딩테스트/hackerrank
2023. 7. 21. 19:43