Study/SQL 21

해커랭크 SQL Basic Select - Weather Observation Station 4

해커랭크 SQL Basic Select Weather Observation Station 4 📝 풀이 SELECT COUNT(city) - COUNT(UNIQUE(city)) FROM station 문제) Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table. For example, if there are three records in the table with CITY values 'New York', 'New York', 'Bengalaru', there are 2 different city names: 'New York' and..

Study/SQL 2023.03.12

해커랭크 SQL Basic Select - Weather Observation Station 3

해커랭크 SQL Basic Select Weather Observation Station 3 📝 풀이 더보기 SELECT DISTINCT city FROM station WHERE id % 2 = 0 문제) Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer. 문제를 보면 짝수 ID 번호를 가진 도시의 도시 이름 목록을 문의한다고 한다. 결과를 임의의 순서로 인쇄하지만 응답에서 중복 항목은 제외한다고 되어있다. 먼저 도시 이름 목록을 문의한다고 하여 SELECT city를 적었다가 중복 항..

Study/SQL 2023.03.12