[MySQL] Hackerrank SQL 연습문제 (2)
SQL Übung - Hackerrank
- SQL 문제 풀이를 통한 SQL 연습
Weather Observation Station 6
- 11/11/2021
SELECT DISTINCT(city)
FROM station
WHERE SUBSTRING(city, 1, 1) IN ('a', 'e', 'i', 'o', 'u');
Weather Observation Station 7
- 13/11/2021
SELECT DISTINCT(city)
FROM station
WHERE SUBSTRING(city, -1, 1) IN ('a', 'e', 'i', 'o', 'u');
Weather Observation Station 8
- 13/11/2021
SELECT city
FROM station
WHERE SUBSTRING(city, 1, 1) IN ('a', 'e', 'i', 'o', 'u')
AND SUBSTRING(city, -1, 1) IN ('a', 'e', 'i', 'o', 'u');
Weather Observation Station 9
- 13/11/2021
SELECT DISTINCT(city)
FROM station
WHERE SUBSTRING(city, 1, 1) NOT IN ("a", "e", "i", "o", "u");
Weather Observation Station 10
- 13/11/2021
SELECT DISTINCT(city)
FROM station
WHERE SUBSTRING(city, -1, 1) NOT IN ("a", "e", "i", "o", "u");
Weather Observation Station 11
- 13/11/2021
SELECT DISTINCT(city)
FROM station
WHERE SUBSTRING(city, -1, 1) NOT IN ("a", "e", "i", "o", "u")
OR SUBSTRING(city, 1, 1) NOT IN ("a", "e", "i", "o", "u");
Weather Observation Station 12
- 13/11/2021
SELECT DISTINCT(city)
FROM station
WHERE SUBSTRING(city, -1, 1) NOT IN ("a", "e", "i", "o", "u")
AND SUBSTRING(city, 1, 1) NOT IN ("a", "e", "i", "o", "u");
Higher Than 75 Marks
- 15/11/2021
SELECT Name
FROM Students
WHERE Marks > 75
ORDER BY RIGHT(Name, 3), ID ASC;
Employee Names
- 15/11/2021
SELECT Name
FROM Employee
ORDER BY name;
Employee Salaries
- 16/11/2021
SELECT name
FROM Employee
WHERE salary > 2000
AND months < 10
ORDER BY employee_id;