Hacker Rank SQL

Japan Population Solution

Hello Friends in this article i am gone to share Hacker Rank SQL Solutions with you | Japan Population Solution


Also Visit:  Average Population Solution


 

Problem

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:

Field Type
ID NUMBER
NAME VARCHAR2(17)
COUNTRYCODE VARCHAR2(3)
DISTRICT VARCHAR2(20)
POPULATION NUMBER

 

Solution – Japan Population

MySQL Code
select sum(population) from city where countrycode='JPN';

 


As of August 2023, Japan has a population of almost 125 million, of which nearly 122 million are Japanese nationals. A small population of foreign residents makes up the remainder. In 2019, 92% of the total Japanese population lived in cities. The capital city, Tokyo, has a population of 13.9 million⁵.

As of August 2023, the population density in Japan is 338 per Km² (876 people per mi²) with a total land area of 364,555 Km² (140,755 sq. miles).

Population of Tokyo

The greater Tokyo metropolitan area, which is spread over 3 prefectures, is much larger and has a population that is estimated to be over 36 million. That means the greater Tokyo area is home to 25% of Japan ‘s population, and it’s the most populous metropolitan area in the world.

 

Disclaimer: The above Problems are generated by Hacker Rank but the Solutions are Provided by NYANDER.COM. All Hacker Rank SQL Solutions Shared only for Educational and Learning Purpose.