1. https://www.hackerrank.com/challenges/revising-the-select-query/problem?isFullScreen=true
Q: Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.
The CITY table is described as follows:
A:
SELECT *
FROM city
WHERE population > 100000
AND CountryCode = 'USA'
2. https://www.hackerrank.com/challenges/select-by-id/problem?isFullScreen=true
Q: Query all columns for a city in CITY with the ID 1661.
The CITY table is described as follows:
A:
SELECT *
FROM city
WHERE id = 1661
3. https://www.hackerrank.com/challenges/weather-observation-station-6/problem?isFullScreen=true
Q: Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.
Input Format
The STATION table is described as follows:
A:
SELECT DISTINCT city
FROM station
WHERE city LIKE 'a%'
OR city LIKE 'e%'
OR city LIKE 'i%'
OR city LIKE 'o%'
OR city LIKE 'u%'
4. https://www.hackerrank.com/challenges/weather-observation-station-12/problem?isFullScreen=true
Q: Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain duplicates.
Input Format
The STATION table is described as follows:
A:
SELECT DISTINCT city
FROM station
WHERE city NOT LIKE 'a%'
AND city NOT LIKE 'e%'
AND city NOT LIKE 'i%'
AND city NOT LIKE 'o%'
AND city NOT LIKE 'u%'
AND city NOT LIKE '%a'
AND city NOT LIKE '%e'
AND city NOT LIKE '%i'
AND city NOT LIKE '%o'
AND city NOT LIKE '%u'
- NOT LIKE 이용
'SQL' 카테고리의 다른 글
ORDER BY/LEFT/RIGHT/SUBSTR/CEIL/FLOOR/ROUND + 해커랭크 예제 풀이 (0) | 2023.06.26 |
---|---|
HackerRank 해커랭크 SQL 예제 추가 풀이 (1) (0) | 2023.06.23 |
LIKE/IN/BETWEEN/IS NULL (0) | 2023.06.20 |
WHERE/AND/OR (0) | 2023.06.20 |
SELECT/FROM/LIMIT + 해커랭크 예제 (0) | 2023.06.20 |