1. Weather Observation Station 3 https://www.hackerrank.com/challenges/weather-observation-station-3/problem?isFullScreen=true Weather Observation Station 3 | HackerRankQuery a list of unique CITY names with even ID numbers.www.hackerrank.com/*짝수인 id number를 가지는 시티 네임, 중복 제외짝수는 2로 나눠지는거*/SELECt DISTINCT cityFROM stationWHERE id % 2 = 0 ↓ where절에 이렇게도 쓸 수 있음SELECt DISTINCT cityFROM stationWHERE M..
1. Population Density Differencehttps://www.hackerrank.com/challenges/population-density-difference/problem?isFullScreen=true Population Density Difference | HackerRankQuery the difference between the maximum and minimum city populations in CITY.www.hackerrank.com -- 최대 인구와 최소 인구의 차를 구해라SELECT MAX(population) - MIN(population)FROM city 2. Weather Observation Station 11https://www.hackerrank.com..
집합 연산 UNIONJOIN이 양 옆으로 데이터 테이블을 붙인다 생각하면, UNION은 위아래로 이어 붙이는 것테이블 간에 중복되는 데이터가 있다면 하나로 합쳐서, 그니까 1개만 나타냄 (중복 제외, DISTINCT같은 개념)이게 디폴트값임 UNION ALL테이블 간에 중복되는 데이터가 있더라도 아래에다 그대로 붙여줌. 중복값 포함(합집합같은 개념) Products 테이블에서 price가 5 이하 또는 200 이상인 데이터를 출력해라>> where문에 or 써서도 출력할 수 있지만 동일 테이블 내에서도 union 사용 가능SELECT *FROM productsWHERE price = 200 FULL OUTER JOIN (MySQL에서 지원 안하지만 JOIN으로 구현할 수 있음)LEFT, RIGHT JO..
sql 코테 대비.. 전에 공부하면서 풀었던 문제 제외 1. https://www.hackerrank.com/challenges/weather-observation-station-9/problem?isFullScreen=true Weather Observation Station 9 | HackerRank Query an alphabetically ordered list of CITY names not starting with vowels. www.hackerrank.com Q: Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates. Input Format The..
1. https://www.hackerrank.com/challenges/weather-observation-station-7/problem?isFullScreen=true Weather Observation Station 7 | HackerRank Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. www.hackerrank.com Q: 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 describ..
1. https://www.hackerrank.com/challenges/revising-the-select-query-2/problem?isFullScreen=true Revising the Select Query II | HackerRank Query the city names for all American cities with populations larger than 120,000. www.hackerrank.com Q: Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA. The CITY table is de..