본문 바로가기

algorithm

(114)
[HackerRank] MySQL - Weather Observation Station 12 문제 Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. 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.3 있었는데요 없었습니다 (join) 문제 풀이 SELECT a.animal_id, a.name from animal_ins a join animal_outs b on a.animal_id = b.animal_id where a.datetime > b.datetime order by a.datetime
[HackerRank] MySQL - Weather Observation Station 11 문제 Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. 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]" or city regexp "[^aeiou]$";
[programmers] MySQL - Lv.3 오랜 기간 보호한 동물 (2) (string, date) 문제 풀이 SELECT a.animal_id, a.name from animal_outs a join animal_ins b on a.animal_id = b.animal_id order by a.datetime - b.datetime desc limit 2;
[HackerRank] MySQL - Weather Observation Station 10 문제 Query the list of CITY names from STATION that do not end with vowels. 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]$"; p.s 헤헤;P 열심히해야지!
[programmers] MySQL - Lv.3 오랜 기간 보호한 동물 (1) (join) 문제 풀이 SELECT a.name, a.datetime from animal_ins as a left join animal_outs as b on a.animal_id = b.animal_id where b.animal_id is null order by a.datetime limit 3;
[HackerRank] MySQL - Weather Observation Station 9 문제 Query the list of CITY names from STATION that do not start with vowels. 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]";
[programmers] MySQL - Lv.2 중성화 여부 파악하기 (string, date) 문제 풀이 SELECT animal_id, name, case when sex_upon_intake like 'Neutered%' or sex_upon_intake like 'Spayed%' then 'O' else 'X' end as 중성화 from animal_ins order by animal_id;