Hacker Rank SQL

Average Population Solution

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


Also Visit:  Revising Aggregations – Averages Solution


 

Problem

Query the average population for all cities in CITY, rounded down to the nearest integer.

Input Format

The CITY is described as follows:

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

 

 

Solution – Average Population 

MySQL Code
select floor(avg(population)) from city;

 


What is the average population of the world?

World Population Clock: 8.1 Billion People (LIVE, 2023 … World Population Clock: 8.1 Billion People (LIVE, 2023) – Worldometer.

Define the is average population density

The average population during a calendar year is calculated as the arithmetic mean of the population on 1st January of two consecutive years. The average population is further used in the calculation of demographic indicators, like the crude rates per 1 000 inhabitants, and for some ‘per capita’ indicators.

The population density of World in 2022 was 59.22 people per square kilometer, a 0.83% increase from 2021. The population density of World in 2021 was 58.73 people per square kilometer, a 0.87% increase from 2020. The population density of World in 2020 was 58.23 people per square kilometer, a 0.98% increase from 2019.

 

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.