db_id
stringlengths 4
31
| text
stringlengths 370
4.84k
|
---|---|
activity_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first names of the faculty members playing both Canoeing and Kayaking? | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid |
### Response:
select faculty.lname from faculty join faculty_participates_in on faculty.facid = faculty_participates_in.facid join activity on faculty_participates_in.actid = faculty_participates_in.actid where activity.activity_name = 'Canoeing' intersect select faculty.lname from faculty join faculty_participates_in on faculty.facid = faculty_participates_in.facid join activity on faculty_participates_in.actid = faculty_participates_in.actid where activity.activity_name = 'Kayaking' |
activity_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the ids of the students who participate in Canoeing and Kayaking. | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid |
### Response:
select participates_in.stuid from participates_in join activity on activity.actid = activity.actid where activity.activity_name = 'Canoeing' intersect select participates_in.stuid from participates_in join activity on activity.actid = activity.actid where activity.activity_name = 'Kayaking' |
activity_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which students participate in both Canoeing and Kayaking as their activities? Tell me their student ids. | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid |
### Response:
select participates_in.stuid from participates_in join activity on activity.actid = activity.actid where activity.activity_name = 'Canoeing' intersect select participates_in.stuid from participates_in join activity on activity.actid = activity.actid where activity.activity_name = 'Kayaking' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the name of the airport in the city of Goroka. | 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 from airports where city = 'Goroka' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of the airports in the city of Goroka? | 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 from airports where city = 'Goroka' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the name, city, country, and altitude (or elevation) of the airports in the city of New York. | 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 , elevation from airports where city = 'New York' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name, city, country, and elevation for every airport in the city of New York? | 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 , elevation from airports where city = 'New York' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many airlines 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 count ( * ) from airlines |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the total 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 count ( * ) from airlines |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many airlines does Russia has? | 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 airlines where country = 'Russia' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the number of airlines based in Russia? | 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 airlines where country = 'Russia' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the maximum elevation of all airports in the country of Iceland? | 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 max ( elevation ) from airports where country = 'Iceland' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the highest elevation of an airport in the country of Iceland? | 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 max ( elevation ) from airports where country = 'Iceland' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the name of the airports located in Cuba or Argentina. | 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 from airports where country = 'Cuba' or country = 'Argentina' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of all airports in Cuba or Argentina? | 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 from airports where country = 'Cuba' or country = 'Argentina' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the country of the airlines whose name starts with 'Orbit'. | 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 name like 'Orbit%' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the countries of all airlines whose names start with Orbit? | 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 name like 'Orbit%' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the name of airports whose altitude is between -50 and 50. | 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 from airports where elevation between -50 and 50 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of all airports whose elevation is between -50 and 50? | 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 from airports where elevation between -50 and 50 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which country is the airport that has the highest altitude located in? | 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 airports order by elevation desc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the 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 country from airports order by elevation desc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of airports whose name contain the word 'International'. | 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 airports where name like '%International%' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many airports' names have the word Interanation in them? | 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 airports where name like '%International%' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many different cities do have some airport in the country of Greenland? | 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 city ) from airports where country = 'Greenland' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: In how many cities are there airports in the country of Greenland? | 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 city ) from airports where country = 'Greenland' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of routes operated by 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 ( * ) from airlines join routes on airlines.alid = routes.alid where airlines.name = 'American Airlines' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many routes does American Airlines operate? | 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 airlines join routes on airlines.alid = routes.alid where airlines.name = 'American Airlines' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of routes whose destination airports are in Canada. | 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 airports join routes on airports.apid = routes.dst_apid where country = 'Canada' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many routes end in a Canadian 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 ( * ) from airports join routes on airports.apid = routes.dst_apid where country = 'Canada' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the name, city, and country of the airport that has the lowest altitude. | 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 asc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name, city, and country of the airport with the lowest altitude? | 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 asc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the number of routes with destination airport in Italy operated by the airline with name '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 ( * ) from routes join airports on routes.dst_apid = airports.apid join airlines on routes.alid = airlines.alid where airports.country = 'Italy' and airlines.name = 'American Airlines' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the number of routes operated by the airline American Airlines whose destinations are 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 join airlines on routes.alid = airlines.alid where airports.country = 'Italy' and airlines.name = 'American Airlines' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of routes that have destination John F Kennedy International 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 ( * ) from airports join routes on airports.apid = routes.dst_apid where airports.name = 'John F Kennedy International Airport' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the number of routes that end at John F Kennedy International 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 ( * ) from airports join routes on airports.apid = routes.dst_apid where airports.name = 'John F Kennedy International Airport' |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of routes from the United States to Canada. | 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 where dst_apid in ( select apid from airports where country = 'Canada' ) and src_apid in ( select apid from airports where country = 'United States' ) |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many routes go from the United States to Canada? | 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 where dst_apid in ( select apid from airports where country = 'Canada' ) and src_apid in ( select apid from airports where country = 'United States' ) |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the id of routes whose source and destination airports are 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 rid from routes where dst_apid in ( select apid from airports where country = 'United States' ) and src_apid in ( select apid from airports where country = 'United States' ) |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the id of the routes whose source and destination airports are 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 rid from routes where dst_apid in ( select apid from airports where country = 'United States' ) and src_apid in ( select apid from airports where country = 'United States' ) |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the name of airline which runs 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 from airlines join routes on airlines.alid = routes.alid group by airlines.name order by count ( * ) desc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name of the airline with the most 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 from airlines join routes on airlines.alid = routes.alid group by airlines.name order by count ( * ) desc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the busiest source airport that runs most number of routes in China. | 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 from airports join routes on airports.apid = routes.src_apid where airports.country = 'China' group by airports.name order by count ( * ) desc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name of the airport with the most number of routes that start in China? | 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 from airports join routes on airports.apid = routes.src_apid where airports.country = 'China' group by airports.name order by count ( * ) desc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the busiest destination airport that runs most number of routes in China. | 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 from airports join routes on airports.apid = routes.dst_apid where airports.country = 'China' group by airports.name order by count ( * ) desc limit 1 |
flight_4 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name of the airport that is the destination of the most number of routes that start in China? | 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 from airports join routes on airports.apid = routes.dst_apid where airports.country = 'China' group by airports.name order by count ( * ) desc limit 1 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the id of the most recent order? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_id from orders order by date_order_placed desc limit 1 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the id of the order made most recently. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_id from orders order by date_order_placed desc limit 1 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: what are the order id and customer id of the oldest order? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_id , customer_id from orders order by date_order_placed asc limit 1 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the order id and customer id associated with the oldest order. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_id , customer_id from orders order by date_order_placed asc limit 1 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the id of the order whose shipment tracking number is "3452". | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_id from shipments where shipment_tracking_number = '3452' |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which order's shipment tracking number is "3452"? Give me the id of the order. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_id from shipments where shipment_tracking_number = '3452' |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the ids of all the order items whose product id is 11. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_item_id from order_items where product_id = 11 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find all the order items whose product id is 11. What are the order item ids? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select order_item_id from order_items where product_id = 11 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the name of all the distinct customers who have orders with status "Packing". | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select distinct customers.customer_name from customers join orders on customers.customer_id = orders.customer_id where orders.order_status = 'Packing' |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which customers have orders with status "Packing"? Give me the customer names. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select distinct customers.customer_name from customers join orders on customers.customer_id = orders.customer_id where orders.order_status = 'Packing' |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the details of all the distinct customers who have orders with status "On Road". | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select distinct customers.customer_details from customers join orders on customers.customer_id = orders.customer_id where orders.order_status = 'On Road' |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct customers who have orders with status "On Road"? Give me the customer details? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select distinct customers.customer_details from customers join orders on customers.customer_id = orders.customer_id where orders.order_status = 'On Road' |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name of the customer who has the most orders? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select customers.customer_name from customers join orders on customers.customer_id = orders.customer_id group by customers.customer_id order by count ( * ) desc limit 1 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which customer made the most orders? Find the customer name. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select customers.customer_name from customers join orders on customers.customer_id = orders.customer_id group by customers.customer_id order by count ( * ) desc limit 1 |
tracking_orders | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the customer id of the customer who has the most orders? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id |
### Response:
select customers.customer_id from customers join orders on customers.customer_id = orders.customer_id group by customers.customer_id order by count ( * ) desc limit 1 |