❓ Question https://www.hackerrank.com/challenges/name-of-employees Employee Names | HackerRank Print employee names. www.hackerrank.com ❗ Answer SELECT name FROM employee ORDER BY name; 📌 Discussion - ORDER BY에서 이름 순으로 정렬
❓ Question https://www.hackerrank.com/challenges/more-than-75-marks Higher Than 75 Marks | HackerRank Query the names of students scoring higher than 75 Marks. Sort the output by the LAST three characters of each name. www.hackerrank.com ❗ Answer SELECT name FROM students WHERE marks > 75 ORDER BY RIGHT(name,3), id; 📌 Discussion - WHERE에 조건을 걸어주고 ORDER BY에서 이름의 오른쪽 세글자 순으로 정렬해줌
❓ Question https://www.hackerrank.com/challenges/weather-observation-station-12 Weather Observation Station 12 | HackerRank Query an alphabetically ordered list of CITY names not starting and ending with vowels. www.hackerrank.com ❗ Answer SELECT DISTINCT(city) FROM station WHERE (LEFT(city,1) NOT IN ('a','e','i','o','u')) AND (RIGHT(city,1) NOT IN ('a','e','i','o','u')); 📌 Discussion - WHERE절에서..
❓ Question https://www.hackerrank.com/challenges/weather-observation-station-11 Weather Observation Station 11 | HackerRank Query a list of CITY names not starting or ending with vowels. www.hackerrank.com ❗ Answer 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')); 📌 Discussion - WHERE에 OR로 합집합 조건을 걸어줌
❓ Question https://www.hackerrank.com/challenges/weather-observation-station-10 Weather Observation Station 10 | HackerRank Query a list of CITY names not ending in vowels. www.hackerrank.com ❗ Answer SELECT DISTINCT(city) FROM station WHERE RIGHT(city,1) NOT IN ('a','e','i','o','u'); 📌 Discussion - WHERE NOT IN으로 조건문에 포함되지 않는 레코드 추출
❓ Question https://www.hackerrank.com/challenges/weather-observation-station-9 Weather Observation Station 9 | HackerRank Query an alphabetically ordered list of CITY names not starting with vowels. www.hackerrank.com ❗ Answer SELECT DISTINCT(city) FROM station WHERE LEFT(city,1) NOT IN ('a','e','i','o','u') 📌 Discussion - WHERE NOT IN 으로 포함되지 않는 조건을 걸어줌
❓ Question https://www.hackerrank.com/challenges/weather-observation-station-8 Weather Observation Station 8 | HackerRank Query CITY names that start AND end with vowels. www.hackerrank.com ❗ Answer SELECT DISTINCT(city) FROM station WHERE (LEFT(city,1) IN ('a','e','i','o','u')) AND (RIGHT(city,1) IN ('a','e','i','o','u')); 📌 Discussion - WHERE 절에서 LEFT와 RIGHT 조건을 AND로 동시 만족 시키는 레코드만 추출
❓ Question https://www.hackerrank.com/challenges/weather-observation-station-7 Weather Observation Station 7 | HackerRank Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. www.hackerrank.com ❗ Answer SELECT DISTINCT(city) FROM station WHERE RIGHT(city,1) IN ('a','e','i','o','u'); 📌 Discussion - RIGHT(column,n)은 column의 data에서 오른쪽 끝부터 n번째까지 추출하는 함수