해커랭크(19)
-
[HackerRank MySQL] Draw The Triangle 1 & 2 - information_schema.tables
Draw The Triangle 1 P(R) represents a pattern drawn by Julia in R rows. The following pattern represents P(5): * * * * * * * * * * * * * * * Write a query to print the pattern P(20). set @star = 21; select repeat('* ', @star := @star -1) from information_schema.tables limit 20 Draw The Triangle 2 P(R) represents a pattern drawn by Julia in R rows. The following pattern represents P(5): * * * * *..
2021.01.05 -
[HackerRank MySQL] INNER JOIN 문제풀기 (Basic)
Asian Population Given the CITY and COUNTRY tables, query the sum of the populations of all cities where the CONTINENT is 'Asia'. Note: CITY.CountryCode and COUNTRY.Code are matching key columns. Input Format The CITY and COUNTRY tables are described as follows: select sum(city.population) from city inner join country on city.countrycode = country.code where continent = 'asia' African Cities Giv..
2021.01.05 -
[HackerRank MySQL] Weather Observation Station 2, 13-17 - ROUND & TRUNCATE (Basic)
Weather Observation Station 2 Query the following two values from the STATION table: The sum of all values in LAT_N rounded to a scale of 2 decimal places. The sum of all values in LONG_W rounded to a scale of 2 decimal places. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. Output Format Your results must be in th..
2021.01.05 -
[HackerRank MySQL] Count/Sum/Average, Ceil/Floor, Replace 문제풀기 (Basic)
Revising Aggregations - The Count Function Query a count of the number of cities in CITY having a Population larger than 100,000. Input Format The CITY table is described as follows: select count(*) from city where population > 100000 Revising Aggregations - The Sum Function Query the total population of all cities in CITY where District is California. select sum(population) from city where dist..
2021.01.05 -
[HackerRank MySQL] ORDER BY 문제풀기 (Basic)
Higher Than 75 Marks Query the Name of any student in STUDENTS who scored higher than 75 Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID. The STUDENTS table is described as follows: The Namecolumn only contains uppercase (A-Z) and lo..
2021.01.05 -
[HackerRank MySQL] Weather Observation Station 1, 3-12 + REGEXP (Basic) & MOD() Function
Weather Observation Station 1 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. select city, state from station Weather Observation Station 3 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..
2021.01.05