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

Convert text to sql: Find the name, city, and country of the airport that has the highest latitude. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select name , city , country from airports order by elevation desc limit 1

### Instruction:

Convert text to sql: What is the name, city, and country of the airport with the highest elevation? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select name , city , country from airports order by elevation desc limit 1

### Instruction:

Convert text to sql: Find the name and city of the airport which is the destination of the most number of routes. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airports.name , airports.city , routes.dst_apid from airports join routes on airports.apid = routes.dst_apid group by routes.dst_apid order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the name and city of the airport that the most routes end at? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airports.name , airports.city , routes.dst_apid from airports join routes on airports.apid = routes.dst_apid group by routes.dst_apid order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Find the names of the top 10 airlines that operate the most number of routes. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airlines.name , routes.alid from airlines join routes on airlines.alid = routes.alid group by routes.alid order by count ( * ) desc limit 10
### Instruction:

Convert text to sql: For the airline ids with the top 10 most routes operated, what are their names? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airlines.name , routes.alid from airlines join routes on airlines.alid = routes.alid group by routes.alid order by count ( * ) desc limit 10

### Instruction:

Convert text to sql: Find the name and city of the airport which is the source for the most number of flight routes. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airports.name , airports.city , routes.src_apid from airports join routes on airports.apid = routes.src_apid group by routes.src_apid order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the name and city of the airport from most of the routes start? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airports.name , airports.city , routes.src_apid from airports join routes on airports.apid = routes.src_apid group by routes.src_apid order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Find the number of different airports which are the destinations of the American Airlines. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( distinct dst_apid ) from airlines join routes on airlines.alid = routes.alid where airlines.name = 'American Airlines'

### Instruction:

Convert text to sql: What is the number of different different airports that are destinations for American Airlines? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( distinct dst_apid ) from airlines join routes on airlines.alid = routes.alid where airlines.name = 'American Airlines'
### Instruction:

Convert text to sql: Which countries has the most number of airlines? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select country from airlines group by country order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the name of the country with the most number of home airlines? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select country from airlines group by country order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which countries has the most number of airlines whose active status is 'Y'? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select country from airlines where active = 'Y' group by country order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What are the countries with the most airlines whose active status is Y? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select country from airlines where active = 'Y' group by country order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: List all countries and their number of airlines in the descending order of number of airlines. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select country , count ( * ) from airlines group by country order by count ( * ) desc
### Instruction:

Convert text to sql: How many airlines operate out of each country in descending order? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select country , count ( * ) from airlines group by country order by count ( * ) desc

### Instruction:

Convert text to sql: How many airports are there per country? Order the countries by decreasing number of airports. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , country from airports group by country order by count ( * ) desc

### Instruction:

Convert text to sql: What is the number of airports per country, ordered from most to least? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , country from airports group by country order by count ( * ) desc

### Instruction:

Convert text to sql: How many airports are there per city in the United States? Order the cities by decreasing number of airports. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , city from airports where country = 'United States' group by city order by count ( * ) desc

### Instruction:

Convert text to sql: How many airports are there per city in the US ordered from most to least? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , city from airports where country = 'United States' group by city order by count ( * ) desc
### Instruction:

Convert text to sql: Return the cities with more than 3 airports in the United States. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city from airports where country = 'United States' group by city having count ( * ) > 3

### Instruction:

Convert text to sql: What is the number of cities in the United States with more than 3 airports? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city from airports where country = 'United States' group by city having count ( * ) > 3

### Instruction:

Convert text to sql: How many cities are there that have more than 3 airports? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) from ( select city from airports group by city having count ( * ) > 3 )

### Instruction:

Convert text to sql: What is the count of cities with more than 3 airports? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) from ( select city from airports group by city having count ( * ) > 3 )

### Instruction:

Convert text to sql: List the cities which have more than one airport and number of airports. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city , count ( * ) from airports group by city having count ( * ) > 1
### Instruction:

Convert text to sql: What are the names of all cities with more than one airport and how many airports do they have? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city , count ( * ) from airports group by city having count ( * ) > 1

### Instruction:

Convert text to sql: List the cities which have more than 2 airports sorted by the number of airports. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city from airports group by city having count ( * ) > 2 order by count ( * ) asc

### Instruction:

Convert text to sql: What are the cities that have more than 2 airports sorted by number of airports? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city from airports group by city having count ( * ) > 2 order by count ( * ) asc

### Instruction:

Convert text to sql: Find the number of routes for each source airport and the airport name. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , airports.name from airports join routes on airports.apid = routes.src_apid group by airports.name

### Instruction:

Convert text to sql: For each airport name, how many routes start at that airport? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , airports.name from airports join routes on airports.apid = routes.src_apid group by airports.name
### Instruction:

Convert text to sql: Find the number of routes and airport name for each source airport, order the results by decreasing number of routes. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , airports.name from airports join routes on airports.apid = routes.src_apid group by airports.name order by count ( * ) desc

### Instruction:

Convert text to sql: For each  airport name, how many routes start at that airport, ordered from most to least? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) , airports.name from airports join routes on airports.apid = routes.src_apid group by airports.name order by count ( * ) desc

### Instruction:

Convert text to sql: Find the average elevation of all airports for each country. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select avg ( elevation ) , country from airports group by country

### Instruction:

Convert text to sql: For each country, what is the average elevation of that country's airports? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select avg ( elevation ) , country from airports group by country

### Instruction:

Convert text to sql: Find the cities which have exactly two airports. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city from airports group by city having count ( * ) = 2
### Instruction:

Convert text to sql: What are the cities with exactly two airports? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select city from airports group by city having count ( * ) = 2

### Instruction:

Convert text to sql: For each country and airline name, how many routes are there? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airlines.country , airlines.name , count ( * ) from airlines join routes on airlines.alid = routes.alid group by airlines.country , airlines.name

### Instruction:

Convert text to sql: What is the total number of routes for each country and airline in that country? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select airlines.country , airlines.name , count ( * ) from airlines join routes on airlines.alid = routes.alid group by airlines.country , airlines.name

### Instruction:

Convert text to sql: Find the number of routes with destination airports in Italy. | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) from routes join airports on routes.dst_apid = airports.apid where airports.country = 'Italy'

### Instruction:

Convert text to sql: What is the number of routes whose destinations are Italian airports? | routes : rid , dst_apid , dst_ap , src_apid , src_ap , alid , airline , codeshare | airports : apid , name , city , country , x , y , elevation , iata , icao | airlines : alid , name , iata , icao , callsign , country , active | routes.alid = airlines.alid | routes.src_apid = airports.apid | routes.dst_apid = airports.apid | 

### Response:

select count ( * ) from routes join airports on routes.dst_apid = airports.apid where airports.country = 'Italy'