problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: Among the countries that use Bosnian as their language, how many of them don't have a positive population growth rate?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(DISTINCT T1.Name) 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.Name = 'Bosnian' AND T3.Population_Growth < 0 |
Write SQL query to solve given problem: What is the average percentage of agriculture of GDP in countries on the African Continent?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT AVG(T4.Agriculture) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN economy AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Africa' |
Write SQL query to solve given problem: Among the independent countries, how many of them has a GDP per capita of over 5000?. 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 economy AS T3 ON T3.Country = T2.Country WHERE T2.Independence IS NOT NULL AND T3.GDP > 5000 |
Write SQL query to solve given problem: What is the average inflation rate of the biggest continent?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT AVG(T4.Inflation) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN economy AS T4 ON T4.Country = T3.Code WHERE T1.Name = ( SELECT Name FROM continent ORDER BY Area DESC LIMIT 1 ) |
Write SQL query to solve given problem: Which island is city Balikpapan located on? How big is the island?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Name, T3.Area FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Name = 'Balikpapan' |
Write SQL query to solve given problem: List all the cities in Sumatra and state the population of each city.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T3.Name = 'Sumatra' |
Write SQL query to solve given problem: On which island does South Yorkshire situated? State it's longtitude and latitude.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T3.Longitude, T3.Latitude FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Province = 'South Yorkshire' |
Write SQL query to solve given problem: List all islands that are greater than the island on which Warwickshire is located.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT Name FROM island WHERE Area > ( SELECT DISTINCT T3.Area FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Province = 'Warwickshire' ) |
Write SQL query to solve given problem: For island area less than 200, list the island name and city it belongs to.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T3.Name, T1.Name FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T3.Area < 200 |
Write SQL query to solve given problem: In which province is city Glenrothes located? What is the capital of the province?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Province, T1.Capital FROM province AS T1 INNER JOIN city AS T2 ON T1.Name = T2.Province AND T1.Country = T2.Country WHERE T2.Name = 'Glenrothes' |
Write SQL query to solve given problem: List the all the cities and its city population for provinces with population more than 1000000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN province AS T2 ON T2.Name = T1.Province WHERE T2.Population > 1000000 |
Write SQL query to solve given problem: List all the coral islands along with its city and province.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT City, Province FROM locatedOn WHERE Island IN ( SELECT Name FROM island WHERE Type = 'coral' ) |
Write SQL query to solve given problem: What is the average population for all cities location at Baltic Sea?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT AVG(T1.Population) FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN sea AS T3 ON T3.Name = T2.Sea WHERE T3.Name = 'Baltic Sea' |
Write SQL query to solve given problem: Calculate the percentage of population in Edmonton city to the population of its province.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT CAST(T1.Population AS REAL) * 100 / T2.Population FROM city AS T1 INNER JOIN province AS T2 ON T1.Province = T2.Name WHERE T1.Name = 'Edmonton' |
Write SQL query to solve given problem: Which are the rivers that flows to Black Sea?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name FROM river WHERE Sea = 'Black Sea' |
Write SQL query to solve given problem: State the name of the lake in Albania province and in which city does it located at.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Lake, City FROM located WHERE Province = 'Albania' AND Lake IS NOT NULL |
Write SQL query to solve given problem: Name the tallest mountain on Himalaya and what is its height.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name, Height FROM mountain WHERE Mountains = 'Himalaya' ORDER BY Height DESC LIMIT 1 |
Write SQL query to solve given problem: List all the mountains that are volcanic along with its longitude and latitude.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name, Latitude, Longitude FROM mountain WHERE Type = 'volcano' |
Write SQL query to solve given problem: Name all the volcano mountains between the height of 2000 to 4000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name FROM mountain WHERE Type = 'volcano' AND Height BETWEEN 2000 AND 4000 |
Write SQL query to solve given problem: Please state the longest river that flows to the Mediterranean Sea.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name FROM river WHERE Sea = 'Mediterranean Sea' ORDER BY Length DESC LIMIT 1 |
Write SQL query to solve given problem: How many percent of the mountains on Andes which are non-volcanic?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT CAST(SUM(CASE WHEN type != 'volcano' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM mountain WHERE Mountains = 'Andes' |
Write SQL query to solve given problem: List all the cities and provinces located at the rivers that flows to Atlantic Ocean.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Province FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Sea = 'Atlantic Ocean' |
Write SQL query to solve given problem: What is the name and length of rivers located at 'Orleans' city?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Name, T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T1.Name = 'Orleans' |
Write SQL query to solve given problem: What is the height of the mountain on which river 'Lech' is located? Please also provide its longitude and latitude.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Height, T1.Latitude, T1.Longitude FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN located AS T4 ON T4.Province = T3.Name WHERE T4.River = 'Lech' |
Write SQL query to solve given problem: Name the river of which Lorraine is on. Please name the mountains where to source flow from?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.SourceLongitude, T1.SourceLatitude, T1.SourceAltitude FROM river AS T1 INNER JOIN geo_river AS T2 ON T2.River = T1.Name WHERE T2.Province = 'Lorraine' |
Write SQL query to solve given problem: Which mountain does the river source Blue Nile located? State the height of the mountain.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Height FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN geo_source AS T4 ON T4.Province = T3.Name WHERE T4.River = 'Blue Nile' |
Write SQL query to solve given problem: Name the river at Little Rock city. State the length of the river.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T1.Name = 'Little Rock' |
Write SQL query to solve given problem: List all rivers and province it is located that is greater than 1000 in length.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Province, T2.Name FROM geo_river AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name WHERE T2.Length > 1000 |
Write SQL query to solve given problem: In which province and country does Moldoveanu located? State its height.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Province, T2.Country, T1.Height FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain WHERE T1.Name = 'Moldoveanu' |
Write SQL query to solve given problem: Provide all rivers name and length in USA.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T3.Name, T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T2.Country = 'USA' |
Write SQL query to solve given problem: What is the average height of all mountains in Nepal?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT AVG(T1.Height) FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain WHERE T2.Province = 'Nepal' |
Write SQL query to solve given problem: For all cities where Seine is located at, which city has the greatest population? Calculate the difference from the city with least population.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT MAX(T1.Population) - MIN(T1.population) FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = 'Seine' |
Write SQL query to solve given problem: Which are the 2 rivers located at Belgrade city? Which river is longer and how by much?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T1.Length FROM river AS T1 INNER JOIN located AS T2 ON T1.Name = T2.River INNER JOIN city AS T3 ON T3.Name = T2.City WHERE T3.Name = 'Belgrade' |
Write SQL query to solve given problem: Which nations have a 100% Spanish-speaking population?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Country FROM language WHERE Name = 'Spanish' AND Percentage = 100 |
Write SQL query to solve given problem: Which countries are dependent on the British Crown?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Country FROM politics WHERE Government = 'British crown dependency' |
Write SQL query to solve given problem: What are the names of the rivers in Canada?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T1.River FROM located AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Canada' AND T1.River IS NOT NULL |
Write SQL query to solve given problem: What is the name of the country whose citizens have the lowest purchasing power?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM economy AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code ORDER BY T1.Inflation DESC LIMIT 1 |
Write SQL query to solve given problem: What province does the 4th most populous city in the United Kingdom belong to, and how many people live there?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Province, T1.Population FROM city AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'United Kingdom' ORDER BY T1.Population DESC LIMIT 3, 1 |
Write SQL query to solve given problem: How many Jewish residents are there in Moldova?. 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 T1.Name = 'Moldova' AND T2.Name = 'Jewish' |
Write SQL query to solve given problem: What is the average area of Asian countries?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT AVG(Area) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia' |
Write SQL query to solve given problem: Which country is home to the world's tiniest desert, and what are its longitude and latitude?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Country, T1.Latitude, T1.Longitude FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert WHERE T1.Name = ( SELECT Name FROM desert ORDER BY Area ASC LIMIT 1 ) |
Write SQL query to solve given problem: How many people in Montenegro speaks Serbian?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Percentage * T2.Population FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Serbian' AND T2.Name = 'Montenegro' |
Write SQL query to solve given problem: How many mountains are there in the country with the most land area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(Mountain) FROM geo_mountain WHERE Country = ( SELECT Code FROM country ORDER BY Area DESC LIMIT 1 ) |
Write SQL query to solve given problem: Which sea is the shallowest and which country surrounds it?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T2.Name FROM located AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE Sea = ( SELECT Name FROM sea ORDER BY Depth ASC LIMIT 1 ) |
Write SQL query to solve given problem: Which nation's GDP is the lowest among those that are communist states?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Country FROM politics AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country WHERE T1.Government = 'Communist state' ORDER BY T2.GDP ASC LIMIT 1 |
Write SQL query to solve given problem: What kind of political system is in place in the country with the highest inflation rate?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Government FROM politics AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country ORDER BY T2.Inflation DESC LIMIT 1 |
Write SQL query to solve given problem: Which nation has the greatest infant mortality rate among those that attained independence in 1960?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Country FROM politics AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE STRFTIME('%Y', T1.Independence) = '1960' ORDER BY T2.Infant_Mortality DESC LIMIT 1 |
Write SQL query to solve given problem: What is the smallest border's length, and what form of government do the two nations bordering it have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Government, T3.Government FROM politics AS T1 INNER JOIN borders AS T2 ON T1.Country = T2.Country1 INNER JOIN politics AS T3 ON T3.Country = T2.Country2 ORDER BY T2.Length ASC LIMIT 1 |
Write SQL query to solve given problem: Which Arabic-speaking country has the smallest population?. 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 WHERE T2.Name = 'Arabic' AND T2.Percentage = 100 ORDER BY T1.Population ASC LIMIT 1 |
Write SQL query to solve given problem: What provinces encompass the world's biggest desert in terms of overall area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Province FROM geo_desert WHERE Desert = ( SELECT Name FROM desert ORDER BY Area DESC LIMIT 1 ) |
Write SQL query to solve given problem: How many lakes are there in the 4th most populous African country with a republican form of government?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(*) FROM geo_lake WHERE Country = ( SELECT T4.Code FROM ( SELECT T2.Code, T2.Population FROM encompasses AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN politics AS T3 ON T1.Country = T3.Country WHERE T1.Continent = 'Africa' AND T1.Percentage = 100 AND T3.Government = 'republic' ORDER BY Population DESC LIMIT 4 ) AS T4 ORDER BY population ASC LIMIT 1 ) |
Write SQL query to solve given problem: Which religion is most prevalent in Asia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T4.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN religion AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Asia' GROUP BY T4.Name ORDER BY SUM(T4.Percentage) DESC LIMIT 1 |
Write SQL query to solve given problem: What is the difference in population between the two nations where the tallest peak is located?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT * FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Country = T2.Country INNER JOIN country AS T4 ON T4.Code = T3.Country WHERE T1.Name = ( SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1 ) |
Write SQL query to solve given problem: What are the names of the sea that can be found on the island with the biggest area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM islandIn AS T1 INNER JOIN sea AS T2 ON T2.Name = T1.Sea WHERE T1.Island = ( SELECT Name FROM island ORDER BY Area DESC LIMIT 1 ) |
Write SQL query to solve given problem: What are the names of the three nations where the longest river that empties into the Atlantic Ocean stretches to?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T1.Country FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = ( SELECT Name FROM river WHERE Sea = 'Atlantic Ocean' ORDER BY Length DESC LIMIT 1 ) |
Write SQL query to solve given problem: How many people reside in the nation's capital city, which is situated in the nation that attained independence on 8/15/1947?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Population FROM politics AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN city AS T3 ON T3.Name = T2.Capital WHERE T1.Independence = '1947-08-15' |
Write SQL query to solve given problem: What is the total number of Afro-Asian people in the most populous Asian country governed by a monarchy?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T5.Percentage * T6.Population FROM ethnicGroup AS T5 INNER JOIN country AS T6 ON T5.Country = T6.Code WHERE Country = ( SELECT T3.Code FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN politics AS T4 ON T4.Country = T3.Code WHERE T4.Government = 'monarchy' AND T1.Name = 'Asia' ORDER BY T3.Population DESC LIMIT 1 ) AND T5.Name = 'Afro-Asian' |
Write SQL query to solve given problem: What are the names of the cities along the Euphrat River's course? Indicate the capital city of the nation where the Euphrat River flows.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.City, T1.Capital FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = 'Euphrat' |
Write SQL query to solve given problem: What is the proportion of English-speaking citizens in the countries that rely on the United States compared to the total number of citizens in those countries?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country INNER JOIN politics AS T3 ON T3.Country = T2.Country WHERE T3.Dependent = 'USA' AND T2.Name = 'English' |
Write SQL query to solve given problem: Which federal republic country in Europe has the most provinces, and what proportion of GDP is devoted to services?
Calculate the population density as well.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Country, T2.Service , SUM(T1.Population) / SUM(T1.Area) FROM province AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country WHERE T1.Country IN ( SELECT Country FROM encompasses WHERE Continent = 'Europe' ) GROUP BY T1.Country, T2.Service ORDER BY COUNT(T1.Name) DESC LIMIT 1 |
Write SQL query to solve given problem: What is the capital of the 3rd most populated country in Asia and what is the capital city's ratio in percentage (%) against the overall population of the country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T4.Capital, CAST(T3.Population AS REAL) * 100 / T4.Population FROM city AS T3 INNER JOIN ( SELECT T1.Capital , T1.Population FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia' ORDER BY T1.Population DESC LIMIT 2, 1 ) AS T4 ON T3.Name = T4.Capital |
Write SQL query to solve given problem: What's the name of the second biggest desert?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name FROM desert ORDER BY Area DESC LIMIT 1, 1 |
Write SQL query to solve given problem: What is the main spoken language in MNE?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Name FROM language WHERE Country = 'MNE' ORDER BY Percentage DESC LIMIT 1 |
Write SQL query to solve given problem: What's the percentage of people in Cayman Islands speak English?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Percentage FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Cayman Islands' AND T1.Name = 'English' |
Write SQL query to solve given problem: Which country was the source of Pjandsh River? 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 located AS T2 ON T1.Code = T2.Country WHERE T2.River = 'Pjandsh' |
Write SQL query to solve given problem: For the countries have the population north of a billion, which one has the lowest GDP? 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 economy AS T2 ON T1.Code = T2.Country WHERE T1.Population > 1000000000 ORDER BY T2.GDP ASC LIMIT 1 |
Write SQL query to solve given problem: What is the capital of the country that has the Licancabur Mountain?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T4.Capital FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Province = T3.Name WHERE T1.Name = 'Licancabur' |
Write SQL query to solve given problem: How much sea is around the island where Kerinci Mountain is located?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T4.Sea) FROM mountain AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Mountain INNER JOIN island AS T3 ON T3.Name = T2.Island INNER JOIN islandIn AS T4 ON T4.Island = T3.Name WHERE T1.Name = 'Kerinci' |
Write SQL query to solve given problem: Which three countries does the Amazonas flow through? Give the full name of the countries.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT DISTINCT T4.Name FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River INNER JOIN country AS T4 ON T4.Code = T2.Country WHERE T3.Name = 'Amazonas' |
Write SQL query to solve given problem: Which country became independent on 1492-01-01? 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 politics AS T2 ON T1.Code = T2.Country WHERE T2.Independence = '1492-01-01' |
Write SQL query to solve given problem: How many cities in France have a population of more than 100,000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T2.Name) FROM country AS T1 INNER JOIN city AS T2 ON T2.Country = T1.Code WHERE T1.Name = 'France' AND T2.Population > 100000 |
Write SQL query to solve given problem: Among all the rivers finally flows to the sea of 540m in depth, which one has the longest length?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Name FROM sea AS T1 INNER JOIN river AS T2 ON T2.Sea = T1.Name WHERE T1.Depth = 540 ORDER BY T2.Length DESC LIMIT 1 |
Write SQL query to solve given problem: In which Country is the second highest volcanic mountain located in? Give the code of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Country FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province ORDER BY T1.Height DESC LIMIT 1, 1 |
Write SQL query to solve given problem: What is the longitude of the island on which Mount Olympos is located?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Longitude FROM mountain AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Mountain INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Name = 'Olympos' |
Write SQL query to solve given problem: For all the countries that is smaller than 100 square kilometres, which one has the most 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 WHERE T1.Area < 100 ORDER BY T2.GDP DESC LIMIT 1 |
Write SQL query to solve given problem: What is the total number of cities that Japan have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T3.Name) FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T1.Name = 'Japan' |
Write SQL query to solve given problem: Which city has most population other than its capital in Bangladesh?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T1.Name = 'Bangladesh' AND T3.Name <> T1.Capital ORDER BY T3.Population DESC LIMIT 1 |
Write SQL query to solve given problem: Which non capital city has the most people of all?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name <> T1.Capital ORDER BY T3.Population DESC LIMIT 1 |
Write SQL query to solve given problem: In which country is the city of Grozny? 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 province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Grozny' |
Write SQL query to solve given problem: Which religion has the majority of the people in Japan?. 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 = 'Japan' ORDER BY T2.Percentage DESC LIMIT 1 |
Write SQL query to solve given problem: Which two countries have the border in length of 803 km? Give the full names of the countries.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Name, T3.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 INNER JOIN country AS T3 ON T3.Code = T2.Country2 WHERE T2.Length = 803 |
Write SQL query to solve given problem: How many percent of the total area of Russia is in Europe?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Percentage FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T3.Name = 'Russia' AND T1.Name = 'Europe' |
Write SQL query to solve given problem: Give the full names of the countries that are located in more than one continent.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T3.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country GROUP BY T3.Name HAVING COUNT(T3.Name) > 1 |
Write SQL query to solve given problem: How many people are there in Fareham's mother country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Population FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Fareham' |
Write SQL query to solve given problem: What's the number of infant mortality in Switzerland in a year?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.Infant_Mortality * T1.Population * T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Switzerland' |
Write SQL query to solve given problem: How many mountains are there in the United States?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT COUNT(T1.Name) FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Province = T3.Name WHERE T4.Name = 'United States' |
Write SQL query to solve given problem: When did Equatorial Guinea become independent?. 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 = 'Equatorial Guinea' |
Write SQL query to solve given problem: What is the GDP per capita in Switzerland?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T2.GDP / T1.Population FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Switzerland' |
Write SQL query to solve given problem: What is the GDP for Service of the country with Fuenlabrada as its city.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T4.Service * T4.GDP FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name INNER JOIN economy AS T4 ON T4.Country = T2.Country WHERE T3.Name = 'Fuenlabrada' |
Write SQL query to solve given problem: How many times longer is the longest river in Tajikistan than the shortest river?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT MAX(T2.Length) / MIN(T2.Length) FROM located AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name WHERE T1.Country = 'TJ' |
Write SQL query to solve given problem: What is the population density of Hanoi's home country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT T1.Population / T1.Area FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Hanoi' |
Write SQL query to solve given problem: In countries where there is more than one ethnic group, name the ethnic group with the greatest presence in each country and the country to which it corresponds.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Country, Name FROM ethnicGroup AS T1 WHERE Percentage < 100 AND Percentage = ( SELECT MAX(Percentage) FROM ethnicGroup AS T2 WHERE T1.Country = T2.Country ) |
Write SQL query to solve given problem: How many deserts are not located in a single country? Name them.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Desert FROM geo_desert GROUP BY Desert HAVING COUNT(DISTINCT Country) > 1 |
Write SQL query to solve given problem: How many rivers belong to more than one country? Name the provinces where we can find them.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT River, GROUP_CONCAT(Province) FROM geo_river GROUP BY River HAVING COUNT(DISTINCT Country) > 1 |
Write SQL query to solve given problem: What percentage of the border does Angola share with each of the countries with which it borders?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT SUM(CASE WHEN T2.Name = 'Angola' THEN T1.Length ELSE 0 END) * 100 / SUM(T1.Length) FROM borders AS T1 LEFT JOIN country AS T2 ON T1.Country1 = T2.Code |
Write SQL query to solve given problem: What percent of the non volcanic islands in the Lesser Antilles group of islands have an area of no more than 300 square kilometers?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT SUM(CASE WHEN Area <= 300 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM island WHERE Islands = 'Lesser Antilles' AND (Type != 'volcanic' OR Type IS NULL) |
Write SQL query to solve given problem: Of all the countries in which English is spoken, what percentage has English as their only language?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT CAST(SUM(CASE WHEN T2.Percentage = 100 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Name) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'English' |
Write SQL query to solve given problem: Name of the capitals of the countries that have less than 99.95% less population than the country that has the most population.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT Capital FROM country WHERE Population <= ( SELECT MAX(Population) - MAX(Population) * 0.9995 FROM country ) |
Write SQL query to solve given problem: Average length of the rivers flowing into the Donau River.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT * FROM river WHERE Name = 'Donau' |
Write SQL query to solve given problem: Based on the data shown at Target, what percentage of countries are non-Christian?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mondial_geo | SELECT 100 - (CAST(SUM(CASE WHEN Target = 'Christian' THEN 1 ELSE 0 END) AS REAL)) * 100 / COUNT(Country) FROM target |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.