Most populous big country  >>>

Scenario world

See details on the model

In this scenario, we have a single table world in which each row describes a country. The table contains the following attributes:

  • name of type VARCHAR(50) NOT NULL, the name of the country (e.g. France)
  • continent of type VARCHAR(60), in which continent is the country in (e.g. Europe)
  • area of time DECIMAL(10) the area of the country in square kilometer
  • population of type DECIMAL(11) the number of inhabitants
  • gdp of type DECIMAL(14) the Gross Domestic Product
  • capital of type VARCHAR(60) the name of the capital city
  • tld of type VARCHAR(5) the Top Level Domain of the country (the last part of the domain names of the country, e.g. .fr for France)
  • flag of type VARCHAR(255) an url of the flag of the country

Question

In SQL we can perform subqueries. One way of doing that is to replace a table in the from, for instance:

SELECT COUNT(*)
 FROM (SELECT * FROM world WHERE continent = 'Europe') t

retrieves the number of countries in Europe (this is not the only way to do so).

Write a query returning the name and population of the 10 most populous countries among the 20 countries with the greatest area.

Remember that the population and the area may be NULL!


Query


...
Run query first