Category: SQLJoins

Average Population | SQL – HackerRank

                                               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. Do not include continents without cities in

African Cities | SQL:- Hackerrank

                                         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 Format The CITY and COUNTRY tables are described as follows: Query: select city.name. from city INNER JOIN country ON city.countrycode=country.code where continent='Africa';

Asian Population | SQL

                                            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 Format The CITY and COUNTRY tables are described as follows: Query: select sum(City.POPULATION) from Country INNER JOIN CITY ON