Big CountriesThere is a table WorldnamecontinentareapopulationgdpAfghanistanAsia6522302550010020343000AlbaniaEurope28748283174112960000AlgeriaAfrica238174137100000188681000AndorraEurope468781153712000AngolaAfrica124670020609294100990000A country is big if it has an area of bigger than 3 million square km or apopulation of more than 25 million.Write a SQL solution to output big countries' name, population and area.For example, according to the above table, we should output:namepopulationareaAfghanistan25500100652230Algeria371000002381741Optionsselect name, population, areawhere area >= 3000000 or population >= 25000000;select name, populationfrom Worldwhere area >= 3000000 or population >= 25000000;select name, population, areafrom Worldwhere area >= 3000000 or population >= 25;select name, population, areafrom Worldwhere area >= 3000000 or population >= 25000000;
Question
Big CountriesThere is a table WorldnamecontinentareapopulationgdpAfghanistanAsia6522302550010020343000AlbaniaEurope28748283174112960000AlgeriaAfrica238174137100000188681000AndorraEurope468781153712000AngolaAfrica124670020609294100990000A country is big if it has an area of bigger than 3 million square km or apopulation of more than 25 million.Write a SQL solution to output big countries' name, population and area.For example, according to the above table, we should output:namepopulationareaAfghanistan25500100652230Algeria371000002381741Optionsselect name, population, areawhere area >= 3000000 or population >= 25000000;select name, populationfrom Worldwhere area >= 3000000 or population >= 25000000;select name, population, areafrom Worldwhere area >= 3000000 or population >= 25;select name, population, areafrom Worldwhere area >= 3000000 or population >= 25000000;
Solution
The correct SQL query to output the big countries' name, population, and area would be:
SELECT name, population, area
FROM World
WHERE area > 3000000 OR population > 25000000;
This query will select the name, population, and area from the World table and filter out the countries where the area is greater than 3 million square km or the population is more than 25 million.
Similar Questions
Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.The CITY table is described as follows:
Query a count of the number of cities in CITY having a Population larger than .Input FormatThe CITY table is described as follows:
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.
A small country consists of four states: A, B, C, and D. The population of each state is given in the following table. The country's legislature is to have 200 seats.State A B C DPopulation 1,200,000 3,400,000 17,500,000 19,500,000(a) Express each state's population (and total population) in terms of millions.State A B C D TotalPopulation (millions) (b) Find the standard divisor, and round it off to two decimal places.
Given the CITY and COUNTRY tables, query the sum of the populations of all cities where the CONTINENT is 'Asia'.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.