TECH

WEATHER OBSERVATION STATION 6

AKA.DM 2022. 5. 30. 12:24
반응형

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:

 

SELECT DISTINCT CITY
FROM STATION
WHERE 
	CITY LIKE 'a%'
	OR
	CITY LIKE 'e%'
	OR
	CITY LIKE 'i%'
	OR
	CITY LIKE 'o%'
	OR
	CITY LIKE 'or%'
	OR
	CITY LIKE 'u%' ;

where 절에 LIKE '문자%' 를 넣어서 진행함

 

만일 LIKE %문자%로 한 경우 해당 문자가 포함된 값을 노출하였을 것임

 

A, E, I, O, U로 끝나는 도시 찾기

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' ;

 

Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates.

반응형

'TECH' 카테고리의 다른 글

Weather Observation Station 5  (0) 2022.06.09
코로나19로 인한 국내 관광 행태 변화 분석  (0) 2022.06.09
Query a list of CITY and STATE from the STATION table  (0) 2022.05.25
나머지를 구하는 방법 SQL  (0) 2022.05.25
TO_CHAR()  (0) 2022.05.24