융무의 기술블로그
article thumbnail
[SQL][HackerRank] Population Density Difference
Algorithm/SQL 2020. 6. 11. 14:54

https://www.hackerrank.com/challenges/the-blunder/problem?h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen The Blunder | HackerRank Query the amount of error in Sam's result, rounded up to the next integer. www.hackerrank.com Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not realize her keyboard's 0 key was broken until a..

article thumbnail
[SQL][HackerRank] Population Density Difference
Algorithm/SQL 2020. 6. 11. 14:48

https://www.hackerrank.com/challenges/population-density-difference/problem?h_r=next-challenge&h_v=zen Population Density Difference | HackerRank Query the difference between the maximum and minimum city populations in CITY. www.hackerrank.com Query the difference between the maximum and minimum populations in CITY. Input Format The CITY table is described as follows: SELECT MAX(POPULATION) - MI..

article thumbnail
[SQL][HackerRank] Higher Than 75 Marks
Algorithm/SQL 2020. 6. 11. 14:46

https://www.hackerrank.com/challenges/japan-population/problem Japan Population | HackerRank Query to the sum of the populations of all Japanese cities in CITY. www.hackerrank.com Query the sum of the populations for all Japanese cities in CITY. The COUNTRYCODE for Japan is JPN. Input Format The CITY table is described as follows: SELECT SUM(POPULATION) FROM CITY WHERE COUNTRYCODE = 'JPN';

article thumbnail
[SQL][HackerRank] Average Population
Algorithm/SQL 2020. 6. 11. 14:36

https://www.hackerrank.com/challenges/average-population/problem?h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen Average Population | HackerRank Query the average population of all cities, rounded down to the nearest integer. www.hackerrank.com Query the average population for all cities in CITY, rounded down to the nearest integer. Input Format The CITY table is..

article thumbnail
[SQL][HackerRank] Revising Aggregations - Averages
Algorithm/SQL 2020. 6. 11. 14:34

https://www.hackerrank.com/challenges/revising-aggregations-the-average-function/problem?h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen Revising Aggregations - Averages | HackerRank Query the average population of all cities in the District of California. www.hackerrank.com Query the average population of all cities in CITY where District is California. Input Format The CITY table is desc..

article thumbnail
[SQL][HackerRank] Revising Aggregations - The Sum Function
Algorithm/SQL 2020. 6. 11. 14:33

https://www.hackerrank.com/challenges/revising-aggregations-sum/problem?h_r=next-challenge&h_v=zen Revising Aggregations - The Sum Function | HackerRank Query the total population of all cities for in the District of California. www.hackerrank.com Query the total population of all cities in CITY where District is California. Input Format The CITY table is described as follows: query total popula..

article thumbnail
[SQL][HackerRank] Revising Aggregations - The Count Function
Algorithm/SQL 2020. 6. 11. 14:29

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: query count of number of cities ==> SELECT COUNT(ID) in CITY table ==> FROM CITY Population larger than 100000 ==> WHERE POPULATION > 100000 SELECT COUNT(ID) FROM CITY WHERE POPULATION > 100000;

article thumbnail
[SQL][HackerRank] The PADS
Algorithm/SQL 2020. 6. 11. 12:46

https://www.hackerrank.com/challenges/the-pads/problem The PADS | HackerRank Query the name and abbreviated occupation for each person in OCCUPATIONS. www.hackerrank.com Generate the following two result sets: Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For exampl..