DataBase/Hackers Rank
-
HackerRank - Average Population of Each ContinentDataBase/Hackers Rank 2024. 10. 7. 23:05
Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer.Note: CITY.CountryCode and COUNTRY.Code are matching key columns.Input FormatThe CITY and COUNTRY tables are described as follows: AnswerSELECT country.continent , FLOOR(AVG(city.population))FROM c..
-
HackerRank - Population CensusDataBase/Hackers Rank 2024. 10. 7. 23:01
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 FormatThe CITY and COUNTRY tables are described as follows: AnswerSELECT SUM(city.population)FROM city INNER JOIN country ON city.countrycode = country.codeWHERE country.continent = 'Asia' Result27028484
-
African Cities - INNER JOINDataBase/Hackers Rank 2024. 10. 7. 22:58
Given the CITY and COUNTRY tables, query the names of all cities where the CONTINENT is 'Africa'.Note: CITY.CountryCode and COUNTRY.Code are matching key columns.Input FormatThe CITY and COUNTRY tables are described as follows: AnswerSELECT city.nameFROM city INNER JOIN country ON city.countrycode = country.codeWHERE country.continent = 'Africa' ResultYour Output (stdout)QinaWarraq al-ArabK..
-
HackerRank - Type of TriangleDataBase/Hackers Rank 2024. 9. 30. 22:58
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 of A, B, and C don't..