MySQL(38)
-
[LeetCode MySQL] 1179. Reformat Department Table
1179. Reformat Department Table Table: Department +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | revenue | int | | month | varchar | +---------------+---------+ (id, month) is the primary key of this table. The table has information about the revenue of each department per month. The month has values in ["Jan","Feb","Mar","Apr","May","Jun","Jul","Au..
2021.01.11 -
[HackerRank MySQL] Type of Triangle
Type of Triangle Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the following statements for each record in the table: Equilateral: It's a triangle with 3 sides of equal length. Isosceles: It's a triangle with 2 sides of equal length. Scalene: It's a triangle with 3 sides of differing lengths. Not A Triangle: The given values ..
2021.01.11 -
[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