Japan Population in SQL | HackerRank Solution

Hello coders, today we are going to solve Japan Population HackerRank Solution in SQL.

Japan Population in SQL

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:

FieldType
IDNUMBER
NAMEVARCHAR2(17)
COUNTRYCODEVARCHAR2(3)
DISTRICTVARCHAR2(20)
POPULATIONNUMBER
CITY

Solution – Japan Population in SQL

MySQL

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

Disclaimer: The above Problem (Japan Population) is generated by Hacker Rank but the Solution is Provided by CodingBroz. This tutorial is only for Educational and Learning Purpose.

Leave a Comment

Your email address will not be published. Required fields are marked *