Revising the Select Query
https://www.hackerrank.com/challenges/revising-the-select-query/problem?isFullScreen=true

Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.
select * from CITY where population>100000 AND countrycode='USA';Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA.
Query all columns (attributes) for every row in the CITY table.
Query all columns for a city in CITY with the ID 1661.
Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN.
Query a list of CITY and STATE from the STATION table.
The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.
Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer.
Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table. The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.
Weather Observation Station 5
Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest or largest city, choose the one that comes first when ordered alphabetically.
Sample Input
For example, CITY has four entries: DEF, ABC, PQRS and WXY.
Sample Output
์๋์ ์๊ฐํ๊ธฐ ์ข ํ๋ค์๋ค.. ๋ด์ผ ๋ค์ ๊ณฑ์น์ด๋ณด์..! -> 1.30:ํน๋งํ์ฅฌ?
Weather Observation Station 6
Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.
DISTINCT๋ก ํ๋๋ง ์ถ๋ ฅ๋๊ฒ ํ๊ณ , WHERE ์ ์์ LIKE์ ์ฌ์ฉํ๊ณ OR์กฐ๊ฑด์ ์ฌ์ฉํด์ ์ฐพ๋ ๋ฐฉ์
์ ๊ทํํ์์ ์ฌ์ฉํด์๋ ๊ฐ๋ฅํ๊ตฌ๋ ์ ๋? ->https://yongku.tistory.com/entry/HackerRank-Weather-Observation-Station-6-์ค๋ผํดOracle์์ ์๊ฒ๋์์
Weather Observation Station 7
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
์ ๋ฌธ์ ์ ๊ฐ์ ๋งฅ๋ฝ์ด๋ค. ๋ฐ์ ๋ฐฉ์๋ ๋งค์ฐ ํฅ๋ฏธ๋ก์ ๋ค..! sql์ ์งค๋ผ์ ๋น๊ตํ๋ ๋ฐฉ์๋ ์๋ค๋ ๊ฒ์ด..!
Weather Observation Station 8
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.
์.. ๊ทธ๋ ๊ฒ ์ด๋ ต์ง ์๊ฒ ํธ๋๊น ์ด๋ ๊ฒ ๋์ค๋๋ฐ ์ด๋ป๊ฒ ๋ ๊ฐ๋จํ๊ฒ ํ ์ ์์๊น๋ฅผ ์๊ฐํด๋ณด์
Weather Observation Station 9
Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates.
์์ ์ฟผ๋ฆฌ๋ ํ ๋งํ๋... ๋ฌธ์ ๋ ๋ฐ์ ์ชฝ ์ฟผ๋ฆฌ๋ค -> ์ ๊ท ํํ์์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์กฐ๊ธ ๋ ์์๋ณด
Weather Observation Station 10
Query the list of CITY names from STATION that do not end with vowels. Your result cannot contain duplicates.
์์์ ๋ํ ์ ๊ท์์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ^[๋ฌด์จ์ํ๋ฒณ~] ์ด๋ ๊ฒ ์ฌ์ฉํ๊ณ
๋๋๋ ๊ฒ์ ๋ํ ์ ๊ท์์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ [๋ฌด์จ์ํ๋ฒณ~]$ ์ด๋ ๊ฒ ์ฌ์ฉํ๋ค!
Weather Observation Station 11
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.
Weather Observation Station 12
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.
Last updated
Was this helpful?