problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: What was the total unit sold for item 10 when the average temperature was below the median temperature?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | sales_in_weather | SELECT SUM(T5.units) FROM weather AS T4 INNER JOIN sales_in_weather AS T5 ON T4.`date` = T5.`date` INNER JOIN relation AS T6 ON T5.store_nbr = T6.store_nbr WHERE T5.item_nbr = 10 AND T4.tavg < ( SELECT AVG(T1.tavg) FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.item_nbr = 10 ) |
Write SQL query to solve given problem: What was the average temperature differences during May 2012 for store number 6 and 7?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | sales_in_weather | SELECT ( SELECT CAST(SUM(tavg) AS REAL) / COUNT(`date`) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr AND T1.`date` LIKE '%2012-05%' AND T2.store_nbr = 6 ) - ( SELECT CAST(SUM(tavg) AS REAL) / COUNT(`date`) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` LIKE '%2012-05%' AND T2.store_nbr = 7 ) |
Write SQL query to solve given problem: In which country does Polish found least in?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Polish' GROUP BY T2.Name, T1.Percentage ORDER BY T1.Percentage ASC LIMIT 1 |
Write SQL query to solve given problem: Which countries have more than 90% of African? List the name of the country in full.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'African' AND T1.Percentage > 90 |
Write SQL query to solve given problem: State the different ethnic group and percentage of the language in Singapore.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Percentage FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Singapore' GROUP BY T1.Name, T1.Percentage |
Write SQL query to solve given problem: Calculate the percentage of country which gained independence as republic after 1970.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT CAST(SUM(CASE WHEN Government = 'republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Country) FROM politics WHERE STRFTIME('%Y', Independence) > '1970' |
Write SQL query to solve given problem: Find the GPD for Bosnia and Herzegovina and the type of government it belongs to.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.GDP, T2.Government FROM economy AS T1 INNER JOIN politics AS T2 ON T1.Country = T2.Country INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T3.Name = 'Bosnia and Herzegovina' |
Write SQL query to solve given problem: State the country and its population with population growth greater than 2% but infant mortality rate less than 5%.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Population FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T2.Population_Growth > 2 AND T2.Infant_Mortality < 5 |
Write SQL query to solve given problem: Which is the majority of the ethnic group in country with great than 10,000,000 population. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Population > 10000000 GROUP BY T2.Name, T2.Percentage ORDER BY T2.Percentage DESC LIMIT 2 |
Write SQL query to solve given problem: Provide the country with its full name which has the most ethnic group? List them all ethnic group together with its percentage.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T2.Name, T2.Percentage FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY COUNT(T2.Name) DESC LIMIT 1 ) GROUP BY T1.Name, T2.Name, T2.Percentage |
Write SQL query to solve given problem: What is the full name of the country with 100% Africans?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Percentage = 100 AND T1.Name = 'African' |
Write SQL query to solve given problem: List the infant mortality of country with the least Amerindian.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Infant_Mortality FROM population AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Country = T2.Country WHERE T2.Name = 'Amerindian' ORDER BY T2.Percentage ASC LIMIT 1 |
Write SQL query to solve given problem: For country with area greater than 600000, what is agriculture percentage of GDP the country contributes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Agriculture FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Area > 600000 AND T2.Agriculture IS NOT NULL |
Write SQL query to solve given problem: Provide the country with republic government which has the highest population growth?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Country FROM population AS T1 INNER JOIN politics AS T2 ON T1.Country = T2.Country WHERE T2.Government = 'republic' ORDER BY T1.Population_Growth DESC LIMIT 1 |
Write SQL query to solve given problem: When did 'Bulgaria' gain independence?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Independence FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Bulgaria' |
Write SQL query to solve given problem: Calculate the population of Arab in each country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Arab' |
Write SQL query to solve given problem: What is the population of African in 'Turks and Caicos Islands'?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'African' AND T1.Name = 'Turks and Caicos Islands' |
Write SQL query to solve given problem: What is the number of growth population for country with the lowest infant mortality?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Population_Growth * T1.Population FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T2.Infant_Mortality IS NOT NULL ORDER BY T2.Infant_Mortality ASC LIMIT 1 |
Write SQL query to solve given problem: Among countries with more than 400,000 GDP, state its capital and population.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Capital, T1.Population FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.GDP > 400000 |
Write SQL query to solve given problem: Calculate the service of GDP for Brazil.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Service * T2.GDP FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Brazil' |
Write SQL query to solve given problem: Which country has the highest infant mortality? Also state its population growth.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country ORDER BY T2.Infant_Mortality DESC LIMIT 1 |
Write SQL query to solve given problem: List all countries with negative growth in population. State the country, population and growth.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Population, T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T2.Population_Growth < 0 |
Write SQL query to solve given problem: For countries with area between 500000 to 1000000, state the country and infant mortality rate.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T2.Infant_Mortality FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Area BETWEEN 500000 AND 1000000 |
Write SQL query to solve given problem: Among the countries with more than 3% population growth rate, state the country name in full along with its GDP.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T3.GDP FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country INNER JOIN economy AS T3 ON T3.Country = T2.Country WHERE T2.Population_Growth > 3 |
Write SQL query to solve given problem: What is the infant mortality rate for Ethiopia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Infant_Mortality FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Ethiopia' |
Write SQL query to solve given problem: How much does the gross domestic products goes to the industry sector for Singapore?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.GDP * T2.Industry FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Singapore' |
Write SQL query to solve given problem: How much is her GDP in agriculture for the country with the least area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.GDP * T2.Agriculture FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T1.Area ASC LIMIT 1 |
Write SQL query to solve given problem: Which country has the biggest percentage of the albanian ethnic group?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Albanian' ORDER BY T2.Percentage DESC LIMIT 1 |
Write SQL query to solve given problem: Among the countries with the African ethnic group, how many of them has a population of over 10000000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'African' AND T1.Area > 10000000 |
Write SQL query to solve given problem: Please list the name of the countries with over 5 ethnic groups.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country GROUP BY T1.Name HAVING COUNT(T1.Name) > 5 |
Write SQL query to solve given problem: Which country has the highest GDP?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.GDP DESC LIMIT 1 |
Write SQL query to solve given problem: Among the countries with a population of over 10000000, how many of them have a GDP of over 500000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.GDP > 500000 AND T1.Population > 10000000 |
Write SQL query to solve given problem: Please list the capital cities of the countries with an inflation rate under 2.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Capital FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.Inflation < 2 |
Write SQL query to solve given problem: Which country has the lowest inflation rate?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.Inflation IS NOT NULL ORDER BY T2.Inflation ASC LIMIT 1 |
Write SQL query to solve given problem: Among the countries whose agriculture percentage of the GDP is under 50%, how many of them have an area of over 8000000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.Agriculture < 50 AND T1.Area > 8000000 |
Write SQL query to solve given problem: How many cities have a salt lake located in it?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T1.City) FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name WHERE T2.Type = 'salt' |
Write SQL query to solve given problem: Please list the depth of the lakes that are located in the Province of Albania.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Depth FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name WHERE T1.Province = 'Albania' |
Write SQL query to solve given problem: The lake with the highest altitude is located in which city?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.City FROM lake AS T1 LEFT JOIN located AS T2 ON T2.Lake = T1.Name ORDER BY T1.Altitude DESC LIMIT 1 |
Write SQL query to solve given problem: How many lakes in the Canary Islands cover an area of over 1000000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Name) FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name WHERE T1.Province = 'Canary Islands' AND T2.Area > 1000000 |
Write SQL query to solve given problem: Which country has the most languages spoken?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY COUNT(T2.Name) DESC LIMIT 1 |
Write SQL query to solve given problem: What is the capital city of the country that has the percentage of Armenian speakers over 90%?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Capital FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Armenian' AND T2.Percentage > 90 |
Write SQL query to solve given problem: Among the countries with a population of under 1000000, how many of them have over 2 languages?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Country FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T1.Population < 1000000 GROUP BY T2.Country HAVING COUNT(T1.Name) > 2 |
Write SQL query to solve given problem: How many organizations are founded in countries with a population of under 1000000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Name) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country WHERE T1.Population < 1000000 |
Write SQL query to solve given problem: How many organizations are established after 1999/1/1 in a country whose GDP is under 500000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Country, COUNT(T1.Country) FROM economy AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T1.GDP < 500000 AND STRFTIME('%Y', T2.Established) < '1999' GROUP BY T1.Country |
Write SQL query to solve given problem: Among the countries with over 3 organizations, how many of them have an inflation rate of over 5%?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Country) FROM economy AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T2.Country IN ( SELECT Country FROM organization GROUP BY Country HAVING COUNT(Country) > 3 ) AND T1.Inflation > 5 |
Write SQL query to solve given problem: How many organizations are established in the country with the most ethnic groups?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Province) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country INNER JOIN ethnicGroup AS T3 ON T3.Country = T2.Country GROUP BY T1.Name ORDER BY COUNT(T3.Name) DESC LIMIT 1 |
Write SQL query to solve given problem: Please list the organization names established in the countries where Dutch is spoken.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM language AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T1.Name = 'Dutch' |
Write SQL query to solve given problem: How many organizations are established in countries where people speak Bosnian?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Name) FROM language AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T1.Name = 'Bosnian' |
Write SQL query to solve given problem: What is the highest infant mortality rate per thousand of the countries whose inflation is under 3?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT MAX(T2.Infant_Mortality) FROM economy AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE T1.Inflation < 3 |
Write SQL query to solve given problem: Among the countries whose GDP is over 1000000, how many of them have a population groth rate of over 3%?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T1.Country) FROM economy AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE T1.GDP > 1000000 AND T2.Population_Growth > 3 |
Write SQL query to solve given problem: Which country has the highest GDP per capita?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.GDP / T1.Population DESC LIMIT 1 |
Write SQL query to solve given problem: What is the highest lake area coverage of a country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Area * 100 / T3.Area FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name INNER JOIN country AS T3 ON T3.Code = T1.Country ORDER BY T2.Longitude DESC LIMIT 1 |
Write SQL query to solve given problem: What is the average population growth rate of countries where more than 3 languages are used?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT SUM(T3.Population_Growth) / COUNT(T3.Country) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country INNER JOIN population AS T3 ON T3.Country = T2.Country WHERE T2.Country IN ( SELECT Country FROM language GROUP BY Country HAVING COUNT(Country) > 3 ) GROUP BY T3.Country |
Write SQL query to solve given problem: Please list the names of the countries with an inflation rate that's 30% above the average.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country GROUP BY T1.Name, T2.Inflation HAVING T2.Inflation > AVG(T2.Inflation) * 1.3 |
Write SQL query to solve given problem: Where country does Baghdad belongs to?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name FROM country WHERE Province = 'Baghdad' |
Write SQL query to solve given problem: Which religion has the largest population in Martinique?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Martinique' ORDER BY T1.population DESC LIMIT 1 |
Write SQL query to solve given problem: Which country is 41% Christian? Give the full name of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Christian' AND T2.Percentage = 41 |
Write SQL query to solve given problem: Which two countries does the Detroit River flow through? Give the full name of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Name FROM located AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name INNER JOIN country AS T3 ON T3.Code = T1.Country WHERE T2.Name = 'Detroit River' |
Write SQL query to solve given problem: Which two countries have the longest border in the world? Give the full name of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Country1, T2.Country2 FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 ORDER BY T2.Length DESC LIMIT 1 |
Write SQL query to solve given problem: Which country has the most neighbors? Give the full name of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC LIMIT 1 |
Write SQL query to solve given problem: Which country is Mountain Cerro Chirripo located in? Give the full name of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T1.Name FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T2.Mountain = 'Cerro Chirripo' |
Write SQL query to solve given problem: How many mountains are there in Indonesia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(DISTINCT T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Indonesia' |
Write SQL query to solve given problem: What is the quantity of the mountains does Japan have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(DISTINCT T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Japan' |
Write SQL query to solve given problem: What is the latitude of the island on which Mount Andrinjitra is located?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Latitude FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island WHERE T2.Mountain = 'Andringitra' |
Write SQL query to solve given problem: Which two countries share the second highest mountain? Give the country code.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Code FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T2.Mountain = ( SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1, 1 ) |
Write SQL query to solve given problem: What is the area of Egypt as a percentage of Asia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Percentage FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent WHERE T3.Name = 'Asia' AND T1.Name = 'Egypt' |
Write SQL query to solve given problem: What is the area of Egypt as a percentage of Asia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Area * 100 / T3.Area FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent WHERE T3.Name = 'Asia' AND T1.Name = 'Egypt' |
Write SQL query to solve given problem: Which city in Japan has the most people in the country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Japan' ORDER BY T2.Population DESC LIMIT 1 |
Write SQL query to solve given problem: For the country in which Olsztyn is located, where is the capital?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Capital FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Olsztyn' |
Write SQL query to solve given problem: In which province is the highest volcano mountain located in?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Province FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T3.Type = 'volcano' ORDER BY T3.Height DESC LIMIT 1 |
Write SQL query to solve given problem: When did Uganda declare independence?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Independence FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Uganda' |
Write SQL query to solve given problem: What kind of government does Iran have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Government FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Iran' |
Write SQL query to solve given problem: Where does Bermuda belong to? Give the full name of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Name FROM locatedOn AS T1 INNER JOIN island AS T2 ON T1.Island = T2.Name INNER JOIN country AS T3 ON T3.Code = T1.Country WHERE T3.Name = 'Bermuda' |
Write SQL query to solve given problem: Where is the capital of country which has the largest percentage of Malay people?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Capital FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Malay' ORDER BY T2.Percentage DESC LIMIT 1 |
Write SQL query to solve given problem: For the third largest country, which ethinic group has the most population?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT Name FROM country ORDER BY Area DESC LIMIT 2, 1 ) GROUP BY T2.Name ORDER BY T2.Percentage * T1.Population DESC LIMIT 1 |
Write SQL query to solve given problem: Which country has the city of 114339 in population? Give the full name of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Population = 114339 |
Write SQL query to solve given problem: How many rivers finally flows to the sea of 459m in depth?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(*) FROM river WHERE Sea IN ( SELECT Name FROM sea WHERE Depth = 459 ) |
Write SQL query to solve given problem: What is the area of the country which became independent in 1921/3/13?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Area FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Independence = '1921-03-13' |
Write SQL query to solve given problem: What is the population density of the Petropavl's home country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT CAST(T1.Population AS REAL) / T1.Area FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Petropavl' |
Write SQL query to solve given problem: How many more people speak English than speak Scottish in United Kingdom?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Population * (T2.Percentage - T1.Percentage) FROM ethnicGroup AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Country = T2.Country INNER JOIN country AS T3 ON T1.Country = T3.Code WHERE T1.Name = 'Scottish' AND T2.Name = 'English' AND T3.Name = 'United Kingdom' |
Write SQL query to solve given problem: What is the most populated city of the 12th highest density country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT Name FROM country ORDER BY CAST(Population AS REAL) / Area LIMIT 11, 1 ) ORDER BY T2.Population DESC LIMIT 1 |
Write SQL query to solve given problem: How many times longer is the longest border in the United States than the shortest?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT MAX(T2.Length) / MIN(T2.Length) FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country2 WHERE T1.Name = 'United States' |
Write SQL query to solve given problem: Please list the capital cities of the countries that have more than 4 mountains.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Capital FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country GROUP BY T1.Name, T1.Capital HAVING COUNT(T1.Name) > 4 |
Write SQL query to solve given problem: How many mountains are there in the country with the greatest population?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY T1.Population DESC LIMIT 1 |
Write SQL query to solve given problem: Among the countries whose agriculture takes up more than 40% of its GDP, how many of them have less than 2 mountains?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T3.Country) FROM ( SELECT T1.Country FROM economy AS T1 INNER JOIN geo_mountain AS T2 ON T1.Country = T2.Country WHERE T1.Industry < 40 GROUP BY T1.Country HAVING COUNT(T1.Country) < 2 ) AS T3 |
Write SQL query to solve given problem: Please list the mountains in the country with the lowest inflation rate.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Mountain FROM geo_mountain WHERE Country = ( SELECT Country FROM economy ORDER BY Inflation ASC LIMIT 1 ) |
Write SQL query to solve given problem: Among the independent countries whose type of government is republic, what is the biggest number of deserts they have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T3.Desert) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN geo_desert AS T3 ON T3.Country = T2.Country WHERE T2.Government = 'republic' |
Write SQL query to solve given problem: Please list the deserts in the countries whose population is over 100000 and covers an area of under 500000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Desert FROM country AS T1 INNER JOIN geo_desert AS T2 ON T1.Code = T2.Country WHERE T1.Area > 100000 AND T1.Population < 500000 |
Write SQL query to solve given problem: How many deserts are there in a country where over 90% of people speaks Armenian?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Desert) FROM country AS T1 INNER JOIN geo_desert AS T2 ON T1.Code = T2.Country INNER JOIN language AS T3 ON T1.Code = T2.Country WHERE T3.Name = 'Armenian' AND T3.Percentage > 90 |
Write SQL query to solve given problem: Which mountain is the highest in an independent country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T4.Name FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN geo_mountain AS T3 ON T3.Country = T2.Country INNER JOIN mountain AS T4 ON T4.Name = T3.Mountain WHERE T2.Independence IS NOT NULL ORDER BY T4.Height DESC LIMIT 1 |
Write SQL query to solve given problem: How many volcanic mountains are there in countries whose population is no more than 5000000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(DISTINCT T3.Name) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T3.Type = 'volcanic' AND T1.Population <= 5000000 |
Write SQL query to solve given problem: Among the countries with a GDP of over 1000000, how many of them have mountains higher than 1000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country INNER JOIN economy AS T3 ON T3.Country = T1.Code INNER JOIN mountain AS T4 ON T4.Name = T2.Mountain WHERE T3.GDP > 1000000 AND T4.Height > 1000 |
Write SQL query to solve given problem: What is the greatest length of the border between 2 independent countries?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT MAX(T3.Length) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN borders AS T3 ON T3.Country1 = T2.Country WHERE T2.Independence IS NOT NULL |
Write SQL query to solve given problem: Among the countries whose government type is republic, how many of them shares a border that's longer than 200?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN borders AS T3 ON T3.Country1 = T2.Country WHERE T2.Government = 'republic' AND T3.Length > 200 |
Write SQL query to solve given problem: Please list the countries that share the shortest border.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 ORDER BY T2.Length ASC LIMIT 1 |
Write SQL query to solve given problem: What is the GDP of the European Continent?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT SUM(T4.GDP) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN economy AS T4 ON T4.Country = T1.Code WHERE T3.Name = 'Europe' |
Write SQL query to solve given problem: How many mountains are there on the African Continent?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T3.Name) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN province AS T4 ON T4.Country = T1.Code INNER JOIN geo_mountain AS T5 ON T5.Province = T4.Name WHERE T3.Name = 'European' |
Write SQL query to solve given problem: Of the deserts on the America Continent, which one covers the greatest area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T5.Name FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN geo_desert AS T4 ON T4.Country = T1.Code INNER JOIN desert AS T5 ON T5.Name = T4.Desert WHERE T3.Name = 'America' ORDER BY T5.Area DESC LIMIT 1 |
Write SQL query to solve given problem: Please list the countries on the European Continent that have a population growth of more than 3%.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Country FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN population AS T4 ON T4.Country = T1.Code WHERE T3.Name = 'Europe' AND T4.Population_Growth > 0.03 |
Write SQL query to solve given problem: How many countries on the European Continent has an infant mortality rate per thousand of over 100?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN population AS T4 ON T4.Country = T1.Code WHERE T3.Name = 'Europe' AND T4.Infant_Mortality < 100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.