본문 바로가기

분류 전체보기

(43)
[MySQL/HackerRank] Weather Observation Station 7 Question Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. My Answer select distinct city from station where right(city,1) in ('a','e','i','o','u'); Result 출처 : https://www.hackerrank.com/challenges/we..
[MySQL/HackerRank] Weather Observation Station 6 Question 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: where LAT_N is the northern latitude and LONG_W is the western longitude. My Answer select distinct city from station where left(city,1) in ('a','e','i','o','u'); Result 출처 : https://www.hackerrank.com/cha..
[MySQL/HackerRank] Weather Observation Station 5 Question 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. The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. Sample ..
[MySQL/HackerRank] Weather Observation Station 4 Question 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. For example, if there are three records in the table with CITY values 'New York', 'New York', 'Bengalaru', there are 2 different city names: 'Ne..
[MySQL/HackerRank] Weather Observation Station 3 Question 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. The STATION table is described as follows: My Answer SELECT DISTINCT CITY FROM STATION WHERE ID%2 = 0; Note EVEN : 짝수 ODD : 홀수 Result 출처 : https://www.hackerrank.com/challenges/weather-observation-station-3/problem Weather Observation St..
[MySQL/HackerRank] Weather Observation Station 1 Question 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. My Answer SELECT CITY, STATE FROM STATION; Result 출처 : https://www.hackerrank.com/challenges/weather-observation-station-1/problem Weather Observation Station 1 | HackerRank Write a query to print the CITY and STATE fo..
[MySQL/HackerRank] Japanese Cities' Names Question Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN. The CITY table is described as follows: My Answer SELECT NAME FROM CITY WHERE COUNTRYCODE = 'JPN'; Result 출처 : https://www.hackerrank.com/challenges/japanese-cities-name/problem Japanese Cities' Names | HackerRank In this challenge, you will query a list of all the Japanese cities' names. www..
[MySQL/HackerRank] Japanese Cities' Attributes Question Query all attributes of every Japanese city in the CITY table. The COUNTRYCODE for Japan is JPN. The CITY table is described as follows: My Answer SELECT * FROM CITY WHERE COUNTRYCODE = 'JPN'; Result 출처 : https://www.hackerrank.com/challenges/japanese-cities-attributes/problem Japanese Cities' Attributes | HackerRank Query the attributes of all the cities in Japan. www.hackerrank.com