데이터분석

SQL 문제풀이

[해커랭크 SQL] Basic Select - Employee Salaries

❓ Question https://www.hackerrank.com/challenges/salary-of-employees Employee Salaries | HackerRank Print the names of employees who earn more than $2000 per month and have worked at the company for less than 10 months. www.hackerrank.com ❗ Answer SELECT name FROM employee WHERE salary > 2000 AND months < 10 ORDER BY employee_id; 📌 Discussion - WHERE 에서 salary와 months에서 두가지 조건을 걸어줌

SQL 문제풀이

[해커랭크 SQL] Basic Select - Employee Names

❓ 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에서 이름 순으로 정렬

SQL 문제풀이

[해커랭크 SQL] Basic Select - Higher Than 75 Marks

❓ 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에서 이름의 오른쪽 세글자 순으로 정렬해줌

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 12

❓ 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절에서..

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 11

❓ 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로 합집합 조건을 걸어줌

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 10

❓ 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으로 조건문에 포함되지 않는 레코드 추출

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 9

❓ 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 으로 포함되지 않는 조건을 걸어줌

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 8

❓ 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로 동시 만족 시키는 레코드만 추출

냄비짱
'데이터분석' 태그의 글 목록 (4 Page)