본문 바로가기

SQL52

Hacker rank Weather Observation Station 11 1 2 3 4 5 select distinct city from station where left(city,1) not in ('a','e','i','o','u') or right(city,1) not in ('a','e','i','o','u') cs 2021. 10. 21.
Hacker rank Weather Observation Station 10 1 2 3 select distinct city from station where right(city,1) not in ('a','e','i','o','u') cs 2021. 10. 20.
Hacker rank Weather Observation Station 9 1 2 3 select distinct city from station where left(city,1) not in ('a','e','i','o','u') cs 2021. 10. 20.
Hacker rank Japanese Cities' Attributes 1 2 3 select * from city where countrycode='jpn' cs 2021. 10. 20.
Hacker rank Weather Observation Station 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 select distinct city from station where( left(city,1)='a' or left(city,1)='e' or left(city,1)='i' or left(city,1)='o' or left(city,1)='u' ) and ( right(city,1)='a' or right(city,1)='e' or right(city,1)='i' or right(city,1)='o' or right(city,1)='u' ) cs 2021. 10. 20.
Hacker rank Weather Observation Station 7 1 2 3 4 5 6 7 8 select distinct city from station where right(city,1)='a' or right(city,1)='e' or right(city,1)='i' or right(city,1)='o' or right(city,1)='u' cs 2021. 10. 20.
Hacker rank Weather Observation Station 6 1 2 3 4 5 6 7 8 select city from station where left(city,1)='a' or left(city,1)='e' or left(city,1)='i' or left(city,1)='o' or left(city,1)='u' cs left 함수는 문자열 다루는 함수구요 left(변수명, 글자수) 변수명 의 글자수 왼쪽만큼을 return 합니다 2021. 10. 20.
Hacker rank Weather Observation Station 5 1 2 3 4 5 6 7 8 9 10 select city, length(city) from station order by length(city), city limit 1 ; select city, length(city) from station order by length(city) desc, city limit 1 ; Colored by Color Scripter cs 2021. 10. 20.
Hacker rank Weather Observation Station 4 1 2 select count(city)- count(distinct city) from station cs 중복 제거 == distinct 2021. 10. 20.
Hacker rank Weather Observation Station 3 1 2 3 select distinct city from station where mod(id,2)=0 cs Line 3 이 프로그래밍언어랑 SQL의 차이죠 Python은 %이 나머지 operator이고 mysql 에서는 mod 함수를 씁니다 ^6^ 2021. 10. 20.
Hacker rank Weather Observation Station 1 1 2 select city,state from station cs 2021. 10. 20.
Hacker rank Japanese Cities' Names 1 2 3 select name from city where countrycode='JPN' cs 2021. 10. 20.