본문 바로가기

Algorithm/MySQL

(75)
[해커랭크(HackerRank)] Weather Observation Station 7 (MySQL) 문제 Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. Input Format The STATION table is described as follows: 코드 substring SELECT DISTINCT city FROM Station WHERE substring(city, -1) IN ('a','e','i','o','u') Station 테이블에서 city 이름의 마지막 글자가 모음(a,e,i,o,u)인 목록을 출력 중복 금지 정규표현식 SELECT distinct city FROM Station WHERE city REGEXP '.*[aei..
[해커랭크(HackerRank)] Weather Observation Station 5 (MySQL) 문제 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. The STATION table is described as follows: 코드 Select city, length(city) From Station Order by length(city), city Limit 1; Select c..
[해커랭크(HackerRank)] Japanese Cities' Names (MySQL) 문제 Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN. The CITY table is described as follows: 코드 Select name From City Where countrycode = 'JPN' CITY 테이블에서 이본 도시의 이름을 모두 출력 출처
[해커랭크(HackerRank)] Japanese Cities' Attributes (MySQL) 문제 Query all attributes of every Japanese city in the CITY table. The COUNTRYCODE for Japan is JPN. The CITY table is described as follows: 코드 Select * From City Where countrycode = 'JPN' City 테이블의 모든 일본 도시의 모든 속성을 출력 일본의 COUNTRYCODE = 'JPN' 출처