❓ Question https://www.hackerrank.com/challenges/weather-observation-station-3 Weather Observation Station 3 | HackerRank Query a list of unique CITY names with even ID numbers. www.hackerrank.com ❗ Answer SELECT DISTINCT(city) FROM station WHERE id%2 = 0; 📌 Discussion - DISTINCT로 중복된 레코드 제거
❓ Question https://www.hackerrank.com/challenges/weather-observation-station-1 Weather Observation Station 1 | HackerRank Write a query to print the CITY and STATE for each attribute in the STATION table. www.hackerrank.com ❗ Answer SELECT city, state FROM station; 📌 Discussion - SELECT 원하는 컬럼만 추출
❓ Question https://www.hackerrank.com/challenges/japanese-cities-name Japanese Cities' Names | HackerRank In this challenge, you will query a list of all the Japanese cities' names. www.hackerrank.com ❗ Answer SELECT name FROM city WHERE countrycode = 'JPN'; 📌 Discussion - SELECT 문에서 name 컬럼만 추출
❓ Question https://www.hackerrank.com/challenges/japanese-cities-attributes Japanese Cities' Attributes | HackerRank Query the attributes of all the cities in Japan. www.hackerrank.com ❗ Answer SELECT * FROM city WHERE countrycode = 'JPN'; 📌 Discussion - WHERE 절에서 조건문으로 필터링
❓ Question https://www.hackerrank.com/challenges/select-by-id ❗ Answer SELECT * FROM city WHERE id = 1661; 📌 Discussion - number type 데이터는 숫자형식으로 조건문에 걸어줘야한다.
❓ Question https://www.hackerrank.com/challenges/select-all-sql Select All | HackerRank Query all columns for every row in a table. www.hackerrank.com ❗ Answer SELECT * FROM city; 📌 Discussion - SELECT 절에서 *로 모든 레코드를 추출
❓ Question https://www.hackerrank.com/challenges/revising-the-select-query-2 Revising the Select Query II | HackerRank Query the city names for all American cities with populations larger than 120,000. www.hackerrank.com ❗ Answer SELECT name FROM city WHERE countrycode = 'USA' AND population > 120000; 📌 Discussion WHERE 절에서 조건을 걸어주고 SELECT 절에서 필요 컬럼만 추출
❓ Question https://www.hackerrank.com/challenges/revising-the-select-query Revising the Select Query I | HackerRank Query the data for all American cities with populations larger than 100,000. www.hackerrank.com ❗ Answer SELECT * FROM city WHERE countrycode = 'USA' AND population > 100000; 📌 Discussion WHERE 절에서 조건문으로 필터링