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

Problem
Query the difference between the maximum and minimum populations in CITY.
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 – Population Density Difference in SQL
MySQL
select max(population) - min(population) from city;
Disclaimer: The above Problem (Japan Density Difference) is generated by Hacker Rank but the Solution is Provided by CodingBroz. This tutorial is only for Educational and Learning Purpose.