input stringlengths 667 7.62k | output stringlengths 41 600 | db_id stringlengths 3 31 | query stringlengths 18 577 | question stringlengths 3 224 | schema stringlengths 177 6.14k | primary_keys stringlengths 16 545 | foreign_keys stringlengths 16 1.48k |
|---|---|---|---|---|---|---|---|
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | activity_1 | Activity : actid (text) , activity_name (number) | Participates_in : stuid (text) , actid (number) | Faculty_Participates_in : facid (text) , actid (number) | Student : stuid (text) , lname (number) , fname (text) , age (number) , sex (number) , major (number) , advisor (number) , city_code (number) | Faculty : facid (text) , lname (number) , fname (text) , rank (number) , sex (number) , phone (number) , room (number) , building (number);</schema>"
<primary_keys>[Primary Keys]: activity : actid, participates_in : stuid, faculty_participates_in : facid</primary_keys>"
<foreign_keys>[Foreign Keys]: participates_in : actid = activity : actid | participates_in : stuid = student : stuid | faculty_participates_in : actid = activity : actid | faculty_participates_in : facid = faculty : facid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names of the faculty members playing both Canoeing and Kayaking?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking'</SQL_QUERY> | activity_1 | SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking' | What are the first names of the faculty members playing both Canoeing and Kayaking? | [Schema (values) (types)]: | activity_1 | Activity : actid (text) , activity_name (number) | Participates_in : stuid (text) , actid (number) | Faculty_Participates_in : facid (text) , actid (number) | Student : stuid (text) , lname (number) , fname (text) , age (number) , sex (number) , major (number) , advisor (number) , city_code (number) | Faculty : facid (text) , lname (number) , fname (text) , rank (number) , sex (number) , phone (number) , room (number) , building (number); | [Primary Keys]: activity : actid, participates_in : stuid, faculty_participates_in : facid | [Foreign Keys]: participates_in : actid = activity : actid | participates_in : stuid = student : stuid | faculty_participates_in : actid = activity : actid | faculty_participates_in : facid = faculty : facid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | activity_1 | Activity : actid (text) , activity_name (number) | Participates_in : stuid (text) , actid (number) | Faculty_Participates_in : facid (text) , actid (number) | Student : stuid (text) , lname (number) , fname (text) , age (number) , sex (number) , major (number) , advisor (number) , city_code (number) | Faculty : facid (text) , lname (number) , fname (text) , rank (number) , sex (number) , phone (number) , room (number) , building (number);</schema>"
<primary_keys>[Primary Keys]: activity : actid, participates_in : stuid, faculty_participates_in : facid</primary_keys>"
<foreign_keys>[Foreign Keys]: participates_in : actid = activity : actid | participates_in : stuid = student : stuid | faculty_participates_in : actid = activity : actid | faculty_participates_in : facid = faculty : facid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the ids of the students who participate in Canoeing and Kayaking.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'</SQL_QUERY> | activity_1 | SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' | Find the ids of the students who participate in Canoeing and Kayaking. | [Schema (values) (types)]: | activity_1 | Activity : actid (text) , activity_name (number) | Participates_in : stuid (text) , actid (number) | Faculty_Participates_in : facid (text) , actid (number) | Student : stuid (text) , lname (number) , fname (text) , age (number) , sex (number) , major (number) , advisor (number) , city_code (number) | Faculty : facid (text) , lname (number) , fname (text) , rank (number) , sex (number) , phone (number) , room (number) , building (number); | [Primary Keys]: activity : actid, participates_in : stuid, faculty_participates_in : facid | [Foreign Keys]: participates_in : actid = activity : actid | participates_in : stuid = student : stuid | faculty_participates_in : actid = activity : actid | faculty_participates_in : facid = faculty : facid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | activity_1 | Activity : actid (text) , activity_name (number) | Participates_in : stuid (text) , actid (number) | Faculty_Participates_in : facid (text) , actid (number) | Student : stuid (text) , lname (number) , fname (text) , age (number) , sex (number) , major (number) , advisor (number) , city_code (number) | Faculty : facid (text) , lname (number) , fname (text) , rank (number) , sex (number) , phone (number) , room (number) , building (number);</schema>"
<primary_keys>[Primary Keys]: activity : actid, participates_in : stuid, faculty_participates_in : facid</primary_keys>"
<foreign_keys>[Foreign Keys]: participates_in : actid = activity : actid | participates_in : stuid = student : stuid | faculty_participates_in : actid = activity : actid | faculty_participates_in : facid = faculty : facid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which students participate in both Canoeing and Kayaking as their activities? Tell me their student ids.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'</SQL_QUERY> | activity_1 | SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' | Which students participate in both Canoeing and Kayaking as their activities? Tell me their student ids. | [Schema (values) (types)]: | activity_1 | Activity : actid (text) , activity_name (number) | Participates_in : stuid (text) , actid (number) | Faculty_Participates_in : facid (text) , actid (number) | Student : stuid (text) , lname (number) , fname (text) , age (number) , sex (number) , major (number) , advisor (number) , city_code (number) | Faculty : facid (text) , lname (number) , fname (text) , rank (number) , sex (number) , phone (number) , room (number) , building (number); | [Primary Keys]: activity : actid, participates_in : stuid, faculty_participates_in : facid | [Foreign Keys]: participates_in : actid = activity : actid | participates_in : stuid = student : stuid | faculty_participates_in : actid = activity : actid | faculty_participates_in : facid = faculty : facid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of the airport in the city of Goroka.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM airports WHERE city = 'Goroka'</SQL_QUERY> | flight_4 | SELECT name FROM airports WHERE city = 'Goroka' | Find the name of the airport in the city of Goroka. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the airports in the city of Goroka?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM airports WHERE city = 'Goroka'</SQL_QUERY> | flight_4 | SELECT name FROM airports WHERE city = 'Goroka' | What are the names of the airports in the city of Goroka? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.</question>
[SQL]:
| <SQL_QUERY>SELECT name , city , country , elevation FROM airports WHERE city = 'New York'</SQL_QUERY> | flight_4 | SELECT name , city , country , elevation FROM airports WHERE city = 'New York' | Find the name, city, country, and altitude (or elevation) of the airports in the city of New York. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name, city, country, and elevation for every airport in the city of New York?</question>
[SQL]:
| <SQL_QUERY>SELECT name , city , country , elevation FROM airports WHERE city = 'New York'</SQL_QUERY> | flight_4 | SELECT name , city , country , elevation FROM airports WHERE city = 'New York' | What is the name, city, country, and elevation for every airport in the city of New York? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many airlines are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airlines</SQL_QUERY> | flight_4 | SELECT count(*) FROM airlines | How many airlines are there? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of airlines?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airlines</SQL_QUERY> | flight_4 | SELECT count(*) FROM airlines | What is the total number of airlines? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many airlines does Russia has?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airlines WHERE country = 'Russia'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airlines WHERE country = 'Russia' | How many airlines does Russia has? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of airlines based in Russia?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airlines WHERE country = 'Russia'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airlines WHERE country = 'Russia' | What is the number of airlines based in Russia? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the maximum elevation of all airports in the country of Iceland?</question>
[SQL]:
| <SQL_QUERY>SELECT max(elevation) FROM airports WHERE country = 'Iceland'</SQL_QUERY> | flight_4 | SELECT max(elevation) FROM airports WHERE country = 'Iceland' | What is the maximum elevation of all airports in the country of Iceland? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the highest elevation of an airport in the country of Iceland?</question>
[SQL]:
| <SQL_QUERY>SELECT max(elevation) FROM airports WHERE country = 'Iceland'</SQL_QUERY> | flight_4 | SELECT max(elevation) FROM airports WHERE country = 'Iceland' | What is the highest elevation of an airport in the country of Iceland? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of the airports located in Cuba or Argentina.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'</SQL_QUERY> | flight_4 | SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' | Find the name of the airports located in Cuba or Argentina. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all airports in Cuba or Argentina?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'</SQL_QUERY> | flight_4 | SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' | What are the names of all airports in Cuba or Argentina? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the country of the airlines whose name starts with 'Orbit'.</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airlines WHERE name LIKE 'Orbit%'</SQL_QUERY> | flight_4 | SELECT country FROM airlines WHERE name LIKE 'Orbit%' | Find the country of the airlines whose name starts with 'Orbit'. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the countries of all airlines whose names start with Orbit?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airlines WHERE name LIKE 'Orbit%'</SQL_QUERY> | flight_4 | SELECT country FROM airlines WHERE name LIKE 'Orbit%' | What are the countries of all airlines whose names start with Orbit? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of airports whose altitude is between -50 and 50.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50</SQL_QUERY> | flight_4 | SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 | Find the name of airports whose altitude is between -50 and 50. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all airports whose elevation is between -50 and 50?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50</SQL_QUERY> | flight_4 | SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 | What are the names of all airports whose elevation is between -50 and 50? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which country is the airport that has the highest altitude located in?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airports ORDER BY elevation DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 | Which country is the airport that has the highest altitude located in? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the country of the airport with the highest elevation?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airports ORDER BY elevation DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 | What is the country of the airport with the highest elevation? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of airports whose name contain the word 'International'.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airports WHERE name LIKE '%International%'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airports WHERE name LIKE '%International%' | Find the number of airports whose name contain the word 'International'. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many airports' names have the word Interanation in them?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airports WHERE name LIKE '%International%'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airports WHERE name LIKE '%International%' | How many airports' names have the word Interanation in them? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different cities do have some airport in the country of Greenland?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland'</SQL_QUERY> | flight_4 | SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland' | How many different cities do have some airport in the country of Greenland? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>In how many cities are there airports in the country of Greenland?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland'</SQL_QUERY> | flight_4 | SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland' | In how many cities are there airports in the country of Greenland? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of routes operated by American Airlines.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | Find the number of routes operated by American Airlines. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many routes does American Airlines operate?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | How many routes does American Airlines operate? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of routes whose destination airports are in Canada.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' | Find the number of routes whose destination airports are in Canada. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many routes end in a Canadian airport?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' | How many routes end in a Canadian airport? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name, city, and country of the airport that has the lowest altitude.</question>
[SQL]:
| <SQL_QUERY>SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1</SQL_QUERY> | flight_4 | SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1 | Find the name, city, and country of the airport that has the lowest altitude. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name, city, and country of the airport with the lowest altitude?</question>
[SQL]:
| <SQL_QUERY>SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1</SQL_QUERY> | flight_4 | SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1 | What is the name, city, and country of the airport with the lowest altitude? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name, city, and country of the airport that has the highest latitude.</question>
[SQL]:
| <SQL_QUERY>SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1 | Find the name, city, and country of the airport that has the highest latitude. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name, city, and country of the airport with the highest elevation?</question>
[SQL]:
| <SQL_QUERY>SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1 | What is the name, city, and country of the airport with the highest elevation? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and city of the airport which is the destination of the most number of routes.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1 | Find the name and city of the airport which is the destination of the most number of routes. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name and city of the airport that the most routes end at?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1 | What is the name and city of the airport that the most routes end at? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names of the top 10 airlines that operate the most number of routes.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10</SQL_QUERY> | flight_4 | SELECT T1.name , T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10 | Find the names of the top 10 airlines that operate the most number of routes. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For the airline ids with the top 10 most routes operated, what are their names?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10</SQL_QUERY> | flight_4 | SELECT T1.name , T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10 | For the airline ids with the top 10 most routes operated, what are their names? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and city of the airport which is the source for the most number of flight routes.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1 | Find the name and city of the airport which is the source for the most number of flight routes. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name and city of the airport from most of the routes start?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1 | What is the name and city of the airport from most of the routes start? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of different airports which are the destinations of the American Airlines.</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'</SQL_QUERY> | flight_4 | SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | Find the number of different airports which are the destinations of the American Airlines. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of different different airports that are destinations for American Airlines?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'</SQL_QUERY> | flight_4 | SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | What is the number of different different airports that are destinations for American Airlines? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which countries has the most number of airlines?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1 | Which countries has the most number of airlines? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the country with the most number of home airlines?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1 | What is the name of the country with the most number of home airlines? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which countries has the most number of airlines whose active status is 'Y'?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1 | Which countries has the most number of airlines whose active status is 'Y'? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the countries with the most airlines whose active status is Y?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1 | What are the countries with the most airlines whose active status is Y? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>List all countries and their number of airlines in the descending order of number of airlines.</question>
[SQL]:
| <SQL_QUERY>SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC | List all countries and their number of airlines in the descending order of number of airlines. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many airlines operate out of each country in descending order?</question>
[SQL]:
| <SQL_QUERY>SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC | How many airlines operate out of each country in descending order? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many airports are there per country? Order the countries by decreasing number of airports.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC | How many airports are there per country? Order the countries by decreasing number of airports. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of airports per country, ordered from most to least?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC | What is the number of airports per country, ordered from most to least? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many airports are there per city in the United States? Order the cities by decreasing number of airports.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC | How many airports are there per city in the United States? Order the cities by decreasing number of airports. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many airports are there per city in the US ordered from most to least?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC | How many airports are there per city in the US ordered from most to least? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Return the cities with more than 3 airports in the United States.</question>
[SQL]:
| <SQL_QUERY>SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3</SQL_QUERY> | flight_4 | SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3 | Return the cities with more than 3 airports in the United States. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of cities in the United States with more than 3 airports?</question>
[SQL]:
| <SQL_QUERY>SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3</SQL_QUERY> | flight_4 | SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3 | What is the number of cities in the United States with more than 3 airports? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many cities are there that have more than 3 airports?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3)</SQL_QUERY> | flight_4 | SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3) | How many cities are there that have more than 3 airports? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the count of cities with more than 3 airports?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3)</SQL_QUERY> | flight_4 | SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3) | What is the count of cities with more than 3 airports? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the cities which have more than one airport and number of airports.</question>
[SQL]:
| <SQL_QUERY>SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1</SQL_QUERY> | flight_4 | SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1 | List the cities which have more than one airport and number of airports. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all cities with more than one airport and how many airports do they have?</question>
[SQL]:
| <SQL_QUERY>SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1</SQL_QUERY> | flight_4 | SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1 | What are the names of all cities with more than one airport and how many airports do they have? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the cities which have more than 2 airports sorted by the number of airports.</question>
[SQL]:
| <SQL_QUERY>SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*)</SQL_QUERY> | flight_4 | SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*) | List the cities which have more than 2 airports sorted by the number of airports. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the cities that have more than 2 airports sorted by number of airports?</question>
[SQL]:
| <SQL_QUERY>SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*)</SQL_QUERY> | flight_4 | SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*) | What are the cities that have more than 2 airports sorted by number of airports? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of routes for each source airport and the airport name.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name</SQL_QUERY> | flight_4 | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name | Find the number of routes for each source airport and the airport name. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each airport name, how many routes start at that airport?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name</SQL_QUERY> | flight_4 | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name | For each airport name, how many routes start at that airport? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC | Find the number of routes and airport name for each source airport, order the results by decreasing number of routes. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each airport name, how many routes start at that airport, ordered from most to least?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC</SQL_QUERY> | flight_4 | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC | For each airport name, how many routes start at that airport, ordered from most to least? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average elevation of all airports for each country.</question>
[SQL]:
| <SQL_QUERY>SELECT avg(elevation) , country FROM airports GROUP BY country</SQL_QUERY> | flight_4 | SELECT avg(elevation) , country FROM airports GROUP BY country | Find the average elevation of all airports for each country. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each country, what is the average elevation of that country's airports?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(elevation) , country FROM airports GROUP BY country</SQL_QUERY> | flight_4 | SELECT avg(elevation) , country FROM airports GROUP BY country | For each country, what is the average elevation of that country's airports? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the cities which have exactly two airports.</question>
[SQL]:
| <SQL_QUERY>SELECT city FROM airports GROUP BY city HAVING count(*) = 2</SQL_QUERY> | flight_4 | SELECT city FROM airports GROUP BY city HAVING count(*) = 2 | Find the cities which have exactly two airports. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the cities with exactly two airports?</question>
[SQL]:
| <SQL_QUERY>SELECT city FROM airports GROUP BY city HAVING count(*) = 2</SQL_QUERY> | flight_4 | SELECT city FROM airports GROUP BY city HAVING count(*) = 2 | What are the cities with exactly two airports? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each country and airline name, how many routes are there?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.country , T1.name , count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country , T1.name</SQL_QUERY> | flight_4 | SELECT T1.country , T1.name , count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country , T1.name | For each country and airline name, how many routes are there? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of routes for each country and airline in that country?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.country , T1.name , count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country , T1.name</SQL_QUERY> | flight_4 | SELECT T1.country , T1.name , count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country , T1.name | What is the total number of routes for each country and airline in that country? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of routes with destination airports in Italy.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'</SQL_QUERY> | flight_4 | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' | Find the number of routes with destination airports in Italy. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of routes whose destinations are Italian airports?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'</SQL_QUERY> | flight_4 | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' | What is the number of routes whose destinations are Italian airports? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'</SQL_QUERY> | flight_4 | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' | Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of routes operated by the airline American Airlines whose destinations are in Italy?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'</SQL_QUERY> | flight_4 | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' | What is the number of routes operated by the airline American Airlines whose destinations are in Italy? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of routes that have destination John F Kennedy International Airport.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' | Find the number of routes that have destination John F Kennedy International Airport. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of routes that end at John F Kennedy International Airport?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'</SQL_QUERY> | flight_4 | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' | What is the number of routes that end at John F Kennedy International Airport? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of routes from the United States to Canada.</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | flight_4 | 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') | Find the number of routes from the United States to Canada. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many routes go from the United States to Canada?</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | flight_4 | 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') | How many routes go from the United States to Canada? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the id of routes whose source and destination airports are in the United States.</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | flight_4 | 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') | Find the id of routes whose source and destination airports are in the United States. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the id of the routes whose source and destination airports are in the United States?</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | flight_4 | 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') | What is the id of the routes whose source and destination airports are in the United States? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of airline which runs the most number of routes.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | Find the name of airline which runs the most number of routes. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the airline with the most routes?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | What is the name of the airline with the most routes? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the busiest source airport that runs most number of routes in China.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | Find the busiest source airport that runs most number of routes in China. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the airport with the most number of routes that start in China?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | What is the name of the airport with the most number of routes that start in China? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the busiest destination airport that runs most number of routes in China.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | Find the busiest destination airport that runs most number of routes in China. | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number);</schema>"
<primary_keys>[Primary Keys]: routes : rid, airports : apid, airlines : alid</primary_keys>"
<foreign_keys>[Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the airport that is the destination of the most number of routes that start in China?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_4 | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | What is the name of the airport that is the destination of the most number of routes that start in China? | [Schema (values) (types)]: | flight_4 | routes : rid (text) , dst_apid (number) , dst_ap (number) , src_apid (text) , src_ap (number) , alid (text) , airline (number) , codeshare (text) | airports : apid (text) , name (number) , city (number) , country (text) , x (number) , y (text) , elevation (number) , iata (text) , icao (text) | airlines : alid (text) , name (number) , iata (number) , icao (text) , callsign (number) , country (text) , active (number); | [Primary Keys]: routes : rid, airports : apid, airlines : alid | [Foreign Keys]: routes : alid = airlines : alid | routes : src_apid = airports : apid | routes : dst_apid = airports : apid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the id of the most recent order?</question>
[SQL]:
| <SQL_QUERY>SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1</SQL_QUERY> | tracking_orders | SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1 | What is the id of the most recent order? | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the id of the order made most recently.</question>
[SQL]:
| <SQL_QUERY>SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1</SQL_QUERY> | tracking_orders | SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1 | Find the id of the order made most recently. | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>what are the order id and customer id of the oldest order?</question>
[SQL]:
| <SQL_QUERY>SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1</SQL_QUERY> | tracking_orders | SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1 | what are the order id and customer id of the oldest order? | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the order id and customer id associated with the oldest order.</question>
[SQL]:
| <SQL_QUERY>SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1</SQL_QUERY> | tracking_orders | SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1 | Find the order id and customer id associated with the oldest order. | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the id of the order whose shipment tracking number is "3452".</question>
[SQL]:
| <SQL_QUERY>SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"</SQL_QUERY> | tracking_orders | SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" | Find the id of the order whose shipment tracking number is "3452". | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which order's shipment tracking number is "3452"? Give me the id of the order.</question>
[SQL]:
| <SQL_QUERY>SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"</SQL_QUERY> | tracking_orders | SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" | Which order's shipment tracking number is "3452"? Give me the id of the order. | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the ids of all the order items whose product id is 11.</question>
[SQL]:
| <SQL_QUERY>SELECT order_item_id FROM order_items WHERE product_id = 11</SQL_QUERY> | tracking_orders | SELECT order_item_id FROM order_items WHERE product_id = 11 | Find the ids of all the order items whose product id is 11. | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find all the order items whose product id is 11. What are the order item ids?</question>
[SQL]:
| <SQL_QUERY>SELECT order_item_id FROM order_items WHERE product_id = 11</SQL_QUERY> | tracking_orders | SELECT order_item_id FROM order_items WHERE product_id = 11 | Find all the order items whose product id is 11. What are the order item ids? | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the name of all the distinct customers who have orders with status "Packing".</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing"</SQL_QUERY> | tracking_orders | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing" | List the name of all the distinct customers who have orders with status "Packing". | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which customers have orders with status "Packing"? Give me the customer names.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing"</SQL_QUERY> | tracking_orders | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing" | Which customers have orders with status "Packing"? Give me the customer names. | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the details of all the distinct customers who have orders with status "On Road".</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road"</SQL_QUERY> | tracking_orders | SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" | Find the details of all the distinct customers who have orders with status "On Road". | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the distinct customers who have orders with status "On Road"? Give me the customer details?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road"</SQL_QUERY> | tracking_orders | SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" | What are the distinct customers who have orders with status "On Road"? Give me the customer details? | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the customer who has the most orders?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | tracking_orders | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 | What is the name of the customer who has the most orders? | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which customer made the most orders? Find the customer name.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | tracking_orders | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 | Which customer made the most orders? Find the customer name. | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number);</schema>"
<primary_keys>[Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the customer id of the customer who has the most orders?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | tracking_orders | SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 | What is the customer id of the customer who has the most orders? | [Schema (values) (types)]: | tracking_orders | Customers : customer_id (text) , customer_name (number) , customer_details (text) | Invoices : invoice_number (text) , invoice_date (number) , invoice_details (text) | Orders : order_id (text) , customer_id (number) , order_status (text) , date_order_placed (text) , order_details (number) | Products : product_id (text) , product_name (number) , product_details (text) | Order_Items : order_item_id (text) , product_id (number) , order_id (text) , order_item_status (text) , order_item_details (number) | Shipments : shipment_id (text) , order_id (number) , invoice_number (text) , shipment_tracking_number (text) , shipment_date (number) , other_shipment_details (time) | Shipment_Items : shipment_id (text) , order_item_id (number); | [Primary Keys]: customers : customer_id, invoices : invoice_number, orders : order_id, products : product_id, order_items : order_item_id, shipments : shipment_id | [Foreign Keys]: 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.