richardr1126/spider-context-instruct huggingface dataset:
### Instruction:

Convert text to sql: What are the ranks of captains that are both in the Cutter and Armed schooner classes? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select rank from captain where class = 'Cutter' intersect select rank from captain where class = 'Armed schooner'

### Instruction:

Convert text to sql: Find the captain rank that has no captain in Third-rate ship of the line class. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select rank from captain except select rank from captain where class = 'Third-rate ship of the line'

### Instruction:

Convert text to sql: What are the ranks of captains that have no captain that are in the Third-rate ship of the line class? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select rank from captain except select rank from captain where class = 'Third-rate ship of the line'

### Instruction:

Convert text to sql: What is the name of the youngest captain? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from captain order by age asc limit 1

### Instruction:

Convert text to sql: Return the name of the youngest captain. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from captain order by age asc limit 1

### Instruction:

Convert text to sql: how many ships are there? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) from ship

### Instruction:

Convert text to sql: Count the number of ships. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) from ship

### Instruction:

Convert text to sql: Find the name, type, and flag of the ship that is built in the most recent year. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , type , flag from ship order by built_year desc limit 1

### Instruction:

Convert text to sql: What is the name, type, and flag of the ship that was built in the most recent year? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , type , flag from ship order by built_year desc limit 1
### Instruction:

Convert text to sql: Group by ships by flag, and return number of ships that have each flag. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) , flag from ship group by flag

### Instruction:

Convert text to sql: What are the different ship flags, and how many ships have each? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) , flag from ship group by flag

### Instruction:

Convert text to sql: Which flag is most widely used among all ships? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select flag from ship group by flag order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Return the flag that is most common among all ships. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select flag from ship group by flag order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: List all ship names in the order of built year and class. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from ship order by built_year asc , class

### Instruction:

Convert text to sql: What are the names of ships, ordered by year they were built and their class? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from ship order by built_year asc , class

### Instruction:

Convert text to sql: Find the ship type that are used by both ships with Panama and Malta flags. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select type from ship where flag = 'Panama' intersect select type from ship where flag = 'Malta'

### Instruction:

Convert text to sql: What types of ships have both ships that have Panama Flags and Malta flags? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select type from ship where flag = 'Panama' intersect select type from ship where flag = 'Malta'

### Instruction:

Convert text to sql: In which year were most of ships built? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select built_year from ship group by built_year order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What is the year in which most ships were built? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select built_year from ship group by built_year order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Find the name of the ships that have more than one captain. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select ship.name from ship join captain on ship.ship_id = captain.ship_id group by captain.ship_id having count ( * ) > 1

### Instruction:

Convert text to sql: What are the names of ships that have more than one captain? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select ship.name from ship join captain on ship.ship_id = captain.ship_id group by captain.ship_id having count ( * ) > 1

### Instruction:

Convert text to sql: what are the names and classes of the ships that do not have any captain yet? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , class from ship where ship_id not in ( select ship_id from captain )

### Instruction:

Convert text to sql: Return the names and classes of ships that do not have a captain? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , class from ship where ship_id not in ( select ship_id from captain )

### Instruction:

Convert text to sql: Find the name of the ship that is steered by the youngest captain. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select ship.name from ship join captain on ship.ship_id = captain.ship_id order by captain.age asc limit 1

### Instruction:

Convert text to sql: What is the name of the ship that is commanded by the youngest captain? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select ship.name from ship join captain on ship.ship_id = captain.ship_id order by captain.age asc limit 1

### Instruction:

Convert text to sql: Find the name and flag of ships that are not steered by any captain with Midshipman rank. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , flag from ship where ship_id not in ( select ship_id from captain where rank = 'Midshipman' )
### Instruction:

Convert text to sql: What are the names and flags of ships that do not have a captain with the rank of Midshipman? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , flag from ship where ship_id not in ( select ship_id from captain where rank = 'Midshipman' )

### Instruction:

Convert text to sql: Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select ship.name from ship join captain on ship.ship_id = captain.ship_id where captain.rank = 'Midshipman' intersect select ship.name from ship join captain on ship.ship_id = captain.ship_id where captain.rank = 'Lieutenant'

### Instruction:

Convert text to sql: What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select ship.name from ship join captain on ship.ship_id = captain.ship_id where captain.rank = 'Midshipman' intersect select ship.name from ship join captain on ship.ship_id = captain.ship_id where captain.rank = 'Lieutenant'
### Instruction:

Convert text to sql: What is id of the city that hosted events in the most recent year? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select host_city from hosting_city order by year desc limit 1

### Instruction:

Convert text to sql: Find the city that hosted some events in the most recent year. What is the id of this city? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select host_city from hosting_city order by year desc limit 1

### Instruction:

Convert text to sql: Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select match_id from match where competition = '1994 FIFA World Cup qualification'

### Instruction:

Convert text to sql: What is the match id of the competition called "1994 FIFA World Cup qualification"? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select match_id from match where competition = '1994 FIFA World Cup qualification'

### Instruction:

Convert text to sql: Find the cities which were once a host city after 2010? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city.city from city join hosting_city on city.city_id = hosting_city.host_city where hosting_city.year > 2010
### Instruction:

Convert text to sql: Which cities served as a host city after 2010? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city.city from city join hosting_city on city.city_id = hosting_city.host_city where hosting_city.year > 2010

### Instruction:

Convert text to sql: Which city has hosted the most events? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city.city from city join hosting_city on city.city_id = hosting_city.host_city group by hosting_city.host_city order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Find the city that hosted the most events. | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city.city from city join hosting_city on city.city_id = hosting_city.host_city group by hosting_city.host_city order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select match.venue from city join hosting_city on city.city_id = hosting_city.host_city join match on hosting_city.match_id = match.match_id where city.city = 'Nanjing ( Jiangsu )' and match.competition = '1994 FIFA World Cup qualification'
### Instruction:

Convert text to sql: Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )". | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select match.venue from city join hosting_city on city.city_id = hosting_city.host_city join match on hosting_city.match_id = match.match_id where city.city = 'Nanjing ( Jiangsu )' and match.competition = '1994 FIFA World Cup qualification'

### Instruction:

Convert text to sql: Give me the temperature of Shanghai in January. | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select temperature.jan from city join temperature on city.city_id = temperature.city_id where city.city = 'Shanghai'

### Instruction:

Convert text to sql: What is the temperature of "Shanghai" city in January? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select temperature.jan from city join temperature on city.city_id = temperature.city_id where city.city = 'Shanghai'

### Instruction:

Convert text to sql: What is the host year of city "Taizhou ( Zhejiang )"? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select hosting_city.year from city join hosting_city on city.city_id = hosting_city.host_city where city.city = 'Taizhou ( Zhejiang )'
### Instruction:

Convert text to sql: IN which year did city "Taizhou ( Zhejiang )" serve as a host city? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select hosting_city.year from city join hosting_city on city.city_id = hosting_city.host_city where city.city = 'Taizhou ( Zhejiang )'

### Instruction:

Convert text to sql: Which three cities have the largest regional population? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city from city order by regional_population desc limit 3

### Instruction:

Convert text to sql: What are the three largest cities in terms of regional population? | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city from city order by regional_population desc limit 3

### Instruction:

Convert text to sql: Which city has the lowest GDP? Please list the city name and its GDP. | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city , gdp from city order by gdp asc limit 1

### Instruction:

Convert text to sql: What is the city with the smallest GDP? Return the city and its GDP. | city : city_id , city , hanzi , hanyu_pinyin , regional_population , gdp | match : match_id , date , venue , score , result , competition | temperature : city_id , jan , feb , mar , apr , jun , jul , aug , sep , oct , nov , dec | hosting_city : year , match_id , host_city | temperature.city_id = city.city_id | hosting_city.match_id = match.match_id | hosting_city.host_city = city.city_id | 

### Response:

select city , gdp from city order by gdp asc limit 1