input
stringlengths 201
2.7k
| output
stringlengths 24
744
|
|---|---|
[INST] Here is a database schema:
borders :
Country1 [ TEXT ]
Country2 [ TEXT ]
Length [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: Which two countries have the longest border in the world? Give the full name of the country. [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
borders :
Country1 [ TEXT ]
Country2 [ TEXT ]
Length [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: Which country has the most neighbors? Give the full name of the country. [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: Which country is Mountain Cerro Chirripo located in? Give the full name of the country. [/INST] [/INST]
|
SELECT DISTINCT T1.Name FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T2.Mountain = 'Cerro Chirripo';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: How many mountains are there in Indonesia? [/INST] [/INST]
|
SELECT COUNT(DISTINCT T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Indonesia';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: What is the quantity of the mountains does Japan have? [/INST] [/INST]
|
SELECT COUNT(DISTINCT T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Japan';
|
[INST] Here is a database schema:
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
mountainOnIsland :
Mountain [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: What is the latitude of the island on which Mount Andrinjitra is located? [/INST] [/INST]
|
SELECT T1.Latitude FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island WHERE T2.Mountain = 'Andringitra';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: Which two countries share the second highest mountain? Give the country code. [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the area of Egypt as a percentage of Asia? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the area of Egypt as a percentage of Asia? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: Which city in Japan has the most people in the country? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: For the country in which Olsztyn is located, where is the capital? [/INST] [/INST]
|
SELECT T1.Capital FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Olsztyn';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: In which province is the highest volcano mountain located in? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: When did Uganda declare independence? [/INST] [/INST]
|
SELECT T2.Independence FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Uganda';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: What kind of government does Iran have? [/INST] [/INST]
|
SELECT T2.Government FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Iran';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
locatedOn :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: Where does Bermuda belong to? Give the full name of the country. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
ethnicGroup :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Where is the capital of country which has the largest percentage of Malay people? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
ethnicGroup :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: For the third largest country, which ethinic group has the most population? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: Which country has the city of 114339 in population? Give the full name of the country. [/INST] [/INST]
|
SELECT T1.Name FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Population = 114339;
|
[INST] Here is a database schema:
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
sea :
Name [ TEXT ] primary_key
Depth [ REAL ]
Please write me a SQL statement that answers the following question: How many rivers finally flows to the sea of 459m in depth? [/INST] [/INST]
|
SELECT COUNT(*) FROM river WHERE Sea IN ( SELECT Name FROM sea WHERE Depth = 459 );
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: What is the area of the country which became independent in 1921/3/13? [/INST] [/INST]
|
SELECT T1.Area FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Independence = '1921-03-13';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the population density of the Petropavl's home country? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
ethnicGroup :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: How many more people speak English than speak Scottish in United Kingdom? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the most populated city of the 12th highest density country? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
borders :
Country1 [ TEXT ]
Country2 [ TEXT ]
Length [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: How many times longer is the longest border in the United States than the shortest? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the capital cities of the countries that have more than 4 mountains. [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: How many mountains are there in the country with the greatest population? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: Among the countries whose agriculture takes up more than 40% of its GDP, how many of them have less than 2 mountains? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the mountains in the country with the lowest inflation rate. [/INST] [/INST]
|
SELECT Mountain FROM geo_mountain WHERE Country = ( SELECT Country FROM economy ORDER BY Inflation ASC LIMIT 1 );
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_desert :
Desert [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: Among the independent countries whose type of government is republic, what is the biggest number of deserts they have? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_desert :
Desert [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the deserts in the countries whose population is over 100000 and covers an area of under 500000. [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_desert :
Desert [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
language :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: How many deserts are there in a country where over 90% of people speaks Armenian? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: Which mountain is the highest in an independent country? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: How many volcanic mountains are there in countries whose population is no more than 5000000? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: Among the countries with a GDP of over 1000000, how many of them have mountains higher than 1000? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
borders :
Country1 [ TEXT ]
Country2 [ TEXT ]
Length [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: What is the greatest length of the border between 2 independent countries? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
borders :
Country1 [ TEXT ]
Country2 [ TEXT ]
Length [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: Among the countries whose government type is republic, how many of them shares a border that's longer than 200? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
borders :
Country1 [ TEXT ]
Country2 [ TEXT ]
Length [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: Please list the countries that share the shortest border. [/INST] [/INST]
|
SELECT T1.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 ORDER BY T2.Length ASC LIMIT 1;
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the GDP of the European Continent? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
province :
Name [ TEXT ]
Country [ TEXT ]
Population [ INTEGER ]
Area [ REAL ]
Capital [ TEXT ]
CapProv [ TEXT ]
Please write me a SQL statement that answers the following question: How many mountains are there on the African Continent? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
desert :
Name [ TEXT ] primary_key
Area [ REAL ]
Longitude [ REAL ]
Latitude [ REAL ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
geo_desert :
Desert [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: Of the deserts on the America Continent, which one covers the greatest area? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
population :
Country [ TEXT ] primary_key
Population_Growth [ REAL ]
Infant_Mortality [ REAL ]
Please write me a SQL statement that answers the following question: Please list the countries on the European Continent that have a population growth of more than 3%. [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
population :
Country [ TEXT ] primary_key
Population_Growth [ REAL ]
Infant_Mortality [ REAL ]
Please write me a SQL statement that answers the following question: How many countries on the European Continent has an infant mortality rate per thousand of over 100? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
language :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
population :
Country [ TEXT ] primary_key
Population_Growth [ REAL ]
Infant_Mortality [ REAL ]
Please write me a SQL statement that answers the following question: Among the countries that use Bosnian as their language, how many of them don't have a positive population growth rate? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the average percentage of agriculture of GDP in countries on the African Continent? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: Among the independent countries, how many of them has a GDP per capita of over 5000? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the average inflation rate of the biggest continent? [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
locatedOn :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: Which island is city Balikpapan located on? How big is the island? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
locatedOn :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: List all the cities in Sumatra and state the population of each city. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
locatedOn :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: On which island does South Yorkshire situated? State it's longtitude and latitude. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
locatedOn :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: List all islands that are greater than the island on which Warwickshire is located. [/INST] [/INST]
|
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' );
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
locatedOn :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: For island area less than 200, list the island name and city it belongs to. [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
province :
Name [ TEXT ]
Country [ TEXT ]
Population [ INTEGER ]
Area [ REAL ]
Capital [ TEXT ]
CapProv [ TEXT ]
Please write me a SQL statement that answers the following question: In which province is city Glenrothes located? What is the capital of the province? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
province :
Name [ TEXT ]
Country [ TEXT ]
Population [ INTEGER ]
Area [ REAL ]
Capital [ TEXT ]
CapProv [ TEXT ]
Please write me a SQL statement that answers the following question: List the all the cities and its city population for provinces with population more than 1000000. [/INST] [/INST]
|
SELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN province AS T2 ON T2.Name = T1.Province WHERE T2.Population > 1000000;
|
[INST] Here is a database schema:
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
locatedOn :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
Island [ TEXT ]
Please write me a SQL statement that answers the following question: List all the coral islands along with its city and province. [/INST] [/INST]
|
SELECT City, Province FROM locatedOn WHERE Island IN ( SELECT Name FROM island WHERE Type = 'coral' );
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
sea :
Name [ TEXT ] primary_key
Depth [ REAL ]
Please write me a SQL statement that answers the following question: What is the average population for all cities location at Baltic Sea? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
province :
Name [ TEXT ]
Country [ TEXT ]
Population [ INTEGER ]
Area [ REAL ]
Capital [ TEXT ]
CapProv [ TEXT ]
Please write me a SQL statement that answers the following question: Calculate the percentage of population in Edmonton city to the population of its province. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: Which are the rivers that flows to Black Sea? [/INST] [/INST]
|
SELECT Name FROM river WHERE Sea = 'Black Sea';
|
[INST] Here is a database schema:
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Please write me a SQL statement that answers the following question: State the name of the lake in Albania province and in which city does it located at. [/INST] [/INST]
|
SELECT Lake, City FROM located WHERE Province = 'Albania' AND Lake IS NOT NULL;
|
[INST] Here is a database schema:
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: Name the tallest mountain on Himalaya and what is its height. [/INST] [/INST]
|
SELECT Name, Height FROM mountain WHERE Mountains = 'Himalaya' ORDER BY Height DESC LIMIT 1;
|
[INST] Here is a database schema:
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: List all the mountains that are volcanic along with its longitude and latitude. [/INST] [/INST]
|
SELECT Name, Latitude, Longitude FROM mountain WHERE Type = 'volcano';
|
[INST] Here is a database schema:
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: Name all the volcano mountains between the height of 2000 to 4000. [/INST] [/INST]
|
SELECT Name FROM mountain WHERE Type = 'volcano' AND Height BETWEEN 2000 AND 4000;
|
[INST] Here is a database schema:
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: Please state the longest river that flows to the Mediterranean Sea. [/INST] [/INST]
|
SELECT Name FROM river WHERE Sea = 'Mediterranean Sea' ORDER BY Length DESC LIMIT 1;
|
[INST] Here is a database schema:
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: How many percent of the mountains on Andes which are non-volcanic? [/INST] [/INST]
|
SELECT CAST(SUM(CASE WHEN type != 'volcano' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM mountain WHERE Mountains = 'Andes';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: List all the cities and provinces located at the rivers that flows to Atlantic Ocean. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: What is the name and length of rivers located at 'Orleans' city? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
province :
Name [ TEXT ]
Country [ TEXT ]
Population [ INTEGER ]
Area [ REAL ]
Capital [ TEXT ]
CapProv [ TEXT ]
Please write me a SQL statement that answers the following question: What is the height of the mountain on which river 'Lech' is located? Please also provide its longitude and latitude. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
geo_river :
River [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: Name the river of which Lorraine is on. Please name the mountains where to source flow from? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
geo_source :
River [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
province :
Name [ TEXT ]
Country [ TEXT ]
Population [ INTEGER ]
Area [ REAL ]
Capital [ TEXT ]
CapProv [ TEXT ]
Please write me a SQL statement that answers the following question: Which mountain does the river source Blue Nile located? State the height of the mountain. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: Name the river at Little Rock city. State the length of the river. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
geo_river :
River [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: List all rivers and province it is located that is greater than 1000 in length. [/INST] [/INST]
|
SELECT T1.Province, T2.Name FROM geo_river AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name WHERE T2.Length > 1000;
|
[INST] Here is a database schema:
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: In which province and country does Moldoveanu located? State its height. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: Provide all rivers name and length in USA. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
Please write me a SQL statement that answers the following question: What is the average height of all mountains in Nepal? [/INST] [/INST]
|
SELECT AVG(T1.Height) FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain WHERE T2.Province = 'Nepal';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: For all cities where Seine is located at, which city has the greatest population? Calculate the difference from the city with least population. [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: Which are the 2 rivers located at Belgrade city? Which river is longer and how by much? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
language :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Which nations have a 100% Spanish-speaking population? [/INST] [/INST]
|
SELECT Country FROM language WHERE Name = 'Spanish' AND Percentage = 100;
|
[INST] Here is a database schema:
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: Which countries are dependent on the British Crown? [/INST] [/INST]
|
SELECT Country FROM politics WHERE Government = 'British crown dependency';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Please write me a SQL statement that answers the following question: What are the names of the rivers in Canada? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
Please write me a SQL statement that answers the following question: What is the name of the country whose citizens have the lowest purchasing power? [/INST] [/INST]
|
SELECT T2.Name FROM economy AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code ORDER BY T1.Inflation DESC LIMIT 1;
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
Please write me a SQL statement that answers the following question: What province does the 4th most populous city in the United Kingdom belong to, and how many people live there? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
ethnicGroup :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: How many Jewish residents are there in Moldova? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the average area of Asian countries? [/INST] [/INST]
|
SELECT AVG(Area) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia';
|
[INST] Here is a database schema:
desert :
Name [ TEXT ] primary_key
Area [ REAL ]
Longitude [ REAL ]
Latitude [ REAL ]
geo_desert :
Desert [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: Which country is home to the world's tiniest desert, and what are its longitude and latitude? [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
language :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: How many people in Montenegro speaks Serbian? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: How many mountains are there in the country with the most land area? [/INST] [/INST]
|
SELECT COUNT(Mountain) FROM geo_mountain WHERE Country = ( SELECT Code FROM country ORDER BY Area DESC LIMIT 1 );
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
sea :
Name [ TEXT ] primary_key
Depth [ REAL ]
Please write me a SQL statement that answers the following question: Which sea is the shallowest and which country surrounds it? [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: Which nation's GDP is the lowest among those that are communist states? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
economy :
Country [ TEXT ] primary_key
GDP [ REAL ]
Agriculture [ REAL ]
Service [ REAL ]
Industry [ REAL ]
Inflation [ REAL ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: What kind of political system is in place in the country with the highest inflation rate? [/INST] [/INST]
|
SELECT T1.Government FROM politics AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country ORDER BY T2.Inflation DESC LIMIT 1;
|
[INST] Here is a database schema:
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
population :
Country [ TEXT ] primary_key
Population_Growth [ REAL ]
Infant_Mortality [ REAL ]
Please write me a SQL statement that answers the following question: Which nation has the greatest infant mortality rate among those that attained independence in 1960? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
borders :
Country1 [ TEXT ]
Country2 [ TEXT ]
Length [ REAL ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: What is the smallest border's length, and what form of government do the two nations bordering it have? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
language :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Which Arabic-speaking country has the smallest population? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
desert :
Name [ TEXT ] primary_key
Area [ REAL ]
Longitude [ REAL ]
Latitude [ REAL ]
geo_desert :
Desert [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Please write me a SQL statement that answers the following question: What provinces encompass the world's biggest desert in terms of overall area? [/INST] [/INST]
|
SELECT Province FROM geo_desert WHERE Desert = ( SELECT Name FROM desert ORDER BY Area DESC LIMIT 1 );
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
geo_lake :
Lake [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: How many lakes are there in the 4th most populous African country with a republican form of government? [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
religion :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Which religion is most prevalent in Asia? [/INST] [/INST]
|
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;
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
geo_mountain :
Mountain [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
mountain :
Name [ TEXT ] primary_key
Mountains [ TEXT ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
province :
Name [ TEXT ]
Country [ TEXT ]
Population [ INTEGER ]
Area [ REAL ]
Capital [ TEXT ]
CapProv [ TEXT ]
Please write me a SQL statement that answers the following question: What is the difference in population between the two nations where the tallest peak is located? [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
island :
Name [ TEXT ] primary_key
Islands [ TEXT ]
Area [ REAL ]
Height [ REAL ]
Type [ TEXT ]
Longitude [ REAL ]
Latitude [ REAL ]
islandIn :
Island [ TEXT ]
Sea [ TEXT ]
Lake [ TEXT ]
River [ TEXT ]
sea :
Name [ TEXT ] primary_key
Depth [ REAL ]
Please write me a SQL statement that answers the following question: What are the names of the sea that can be found on the island with the biggest area? [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: What are the names of the three nations where the longest river that empties into the Atlantic Ocean stretches to? [/INST] [/INST]
|
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 );
|
[INST] Here is a database schema:
city :
Name [ TEXT ]
Country [ TEXT ]
Province [ TEXT ]
Population [ INTEGER ]
Longitude [ REAL ]
Latitude [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: How many people reside in the nation's capital city, which is situated in the nation that attained independence on 8/15/1947? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
continent :
Name [ TEXT ] primary_key
Area [ REAL ]
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
encompasses :
Country [ TEXT ]
Continent [ TEXT ]
Percentage [ REAL ]
ethnicGroup :
Country [ TEXT ]
Name [ TEXT ]
Percentage [ REAL ]
politics :
Country [ TEXT ] primary_key
Independence [ DATE ]
Dependent [ TEXT ]
Government [ TEXT ]
Please write me a SQL statement that answers the following question: What is the total number of Afro-Asian people in the most populous Asian country governed by a monarchy? [/INST] [/INST]
|
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';
|
[INST] Here is a database schema:
country :
Name [ TEXT ]
Code [ TEXT ] primary_key
Capital [ TEXT ]
Province [ TEXT ]
Area [ REAL ]
Population [ INTEGER ]
located :
City [ TEXT ]
Province [ TEXT ]
Country [ TEXT ]
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
river :
Name [ TEXT ] primary_key
River [ TEXT ]
Lake [ TEXT ]
Sea [ TEXT ]
Length [ REAL ]
SourceLongitude [ REAL ]
SourceLatitude [ REAL ]
Mountains [ TEXT ]
SourceAltitude [ REAL ]
EstuaryLongitude [ REAL ]
EstuaryLatitude [ REAL ]
Please write me a SQL statement that answers the following question: 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. [/INST] [/INST]
|
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';
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.