전공/Database

[HackerRank] MySQL : Weather Observation Station 1-5

으녜 2022. 5. 12. 23:16
728x90

[Weather Observation Station 1]

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

 

Weather Observation Station 1 | HackerRank

Write a query to print the CITY and STATE for each attribute in the STATION table.

www.hackerrank.com

 

 

[Problem]

 

STATION 테이블에서 CITY와 STATE 리스트를 출력하시오.

 

[Solution]

 

 

[Weather Observation Station 3]

 

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

 

Weather Observation Station 3 | HackerRank

Query a list of unique CITY names with even ID numbers.

www.hackerrank.com

 

 

[Problem]

STATION 테이블에서 ID가 짝수인 도시(CITY)의 이름을 출력하시오. 이때, 순서는 상관없되 중복을 제거하시오.

 

[Solution]

 

 

[Weather Observation Station 4]

 

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

 

Weather Observation Station 4 | HackerRank

Find the number of duplicate CITY names in STATION.

www.hackerrank.com

 

[Problem]

STATION 테이블에서 전체 CITY 수와 유일한 CITY 수의 차이를 출력하시오.

 

[Solution]

 

 

[Weather Observation Station 5]

 

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

 

[Problem]

 

STATION 테이블에서 길이가 가장 긴 CITY와 가장 짧은 CITY 이름과 해당 길이를 각각 출력하시오. 이때, 가장 길거나 짧은 CITY가 여러개라면 알파벳순으로 하나만 출력하시오.

[Example]

 

※ Hint

 

[Solution]

 

 

728x90