algorithm (114) 썸네일형 리스트형 [HackerRank] MySQL - Weather Observation Station 8 문제 Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. 풀이 select distinct city from station where city regexp '^[aeiou]' and city regexp '[aeiou]$'; [programmers] MySQL - Lv.2 DATETIME에서 DATE로 형변환 문제 풀이 SELECT animal_id, name, date_format(datetime, '%Y-%m-%d') 날짜 from animal_ins order by animal_id; [HackerRank] MySQL - Weather Observation Station 7 문제 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: where LAT_N is the northern latitude and LONG_W is the western longitude. 풀이 select distinct city from station where city like '%a' or city like '%e' or city like '%i' or city like '%o' or city like '%u'; [programmers] MySQL - Lv.2 중복 제거하기 (sum, max, min) 문제 풀이 SELECT count(distinct name) count from animal_ins; [HackerRank] MySQL - Weather Observation Station 6 문제 Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. 풀이 select distinct city from station where city like 'a%' or city like 'e%' or city like 'i%' or city like 'o%' or city like 'u%'; [programmers] MySQL - Lv.2 NULL 처리하기 (is null) 문제 풀이 SELECT animal_type, case when name is null then 'No name' else name end as "name", sex_upon_intake from animal_ins order by animal_id; 이 문제는 내가 case문 공부할 때 풀었던 문제인 것 같다. case를 활용하면 위와 같이 답안이 나올 수 있고, 더 간단하게는 coalesce 함수를 이용해서 아래와 같이 나타낼 수도 있다. SELECT animal_type, coalesce(name, 'No name'), sex_upon_intake from animal_ins order by animal_id; 프로그래머스에서 다른 사람들이 푼 답안을 보면 if null을 활용해서 대부분 문제를 푼.. [HackerRank] MySQL - 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. The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. Sample Input .. [programmers] MySQL - Lv.2 입양 시각 구하기(1) (group by) 문제 풀이 select hour(datetime) as hour, count(*) from animal_outs group by hour having hour >= 9 and hour 이전 1 ··· 8 9 10 11 12 13 14 15 다음