Unnamed: 0
int64 0
60k
| text
stringlengths 109
1.06k
|
---|---|
3,800 | <question>: How many lessons were in cancelled state? <context>: CREATE TABLE Lessons (lesson_status_code VARCHAR) <answer>: SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = "Cancelled" |
3,801 | <question>: List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'. <context>: CREATE TABLE Lessons (lesson_id VARCHAR, staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) <answer>: SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%" |
3,802 | <question>: How many lessons taught by staff whose first name has letter 'a' in it? <context>: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR) <answer>: SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%" |
3,803 | <question>: How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn? <context>: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) <answer>: SELECT SUM(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" |
3,804 | <question>: What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? <context>: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) <answer>: SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" |
3,805 | <question>: How many lesson does customer with first name Ray took? <context>: CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR); CREATE TABLE Lessons (customer_id VARCHAR) <answer>: SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray" |
3,806 | <question>: Which last names are both used by customers and by staff? <context>: CREATE TABLE Customers (last_name VARCHAR); CREATE TABLE Staff (last_name VARCHAR) <answer>: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff |
3,807 | <question>: What is the first name of the staff who did not give any lesson? <context>: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (first_name VARCHAR); CREATE TABLE Staff (first_name VARCHAR, staff_id VARCHAR) <answer>: SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id |
3,808 | <question>: What is the id and detail of the vehicle used in lessons for most of the times? <context>: CREATE TABLE Lessons (vehicle_id VARCHAR); CREATE TABLE Vehicles (vehicle_id VARCHAR, vehicle_details VARCHAR) <answer>: SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1 |
3,809 | <question>: How many faculty do we have? <context>: CREATE TABLE Faculty (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Faculty |
3,810 | <question>: What ranks do we have for faculty? <context>: CREATE TABLE Faculty (rank VARCHAR) <answer>: SELECT DISTINCT rank FROM Faculty |
3,811 | <question>: Show all the distinct buildings that have faculty rooms. <context>: CREATE TABLE Faculty (building VARCHAR) <answer>: SELECT DISTINCT building FROM Faculty |
3,812 | <question>: Show the rank, first name, and last name for all the faculty. <context>: CREATE TABLE Faculty (rank VARCHAR, Fname VARCHAR, Lname VARCHAR) <answer>: SELECT rank, Fname, Lname FROM Faculty |
3,813 | <question>: Show the first name, last name, and phone number for all female faculty members. <context>: CREATE TABLE Faculty (Fname VARCHAR, Lname VARCHAR, phone VARCHAR, Sex VARCHAR) <answer>: SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F' |
3,814 | <question>: Show ids for all the male faculty. <context>: CREATE TABLE Faculty (FacID VARCHAR, Sex VARCHAR) <answer>: SELECT FacID FROM Faculty WHERE Sex = 'M' |
3,815 | <question>: How many female Professors do we have? <context>: CREATE TABLE Faculty (Sex VARCHAR, Rank VARCHAR) <answer>: SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = "Professor" |
3,816 | <question>: Show the phone, room, and building for the faculty named Jerry Prince. <context>: CREATE TABLE Faculty (phone VARCHAR, room VARCHAR, building VARCHAR, Fname VARCHAR, Lname VARCHAR) <answer>: SELECT phone, room, building FROM Faculty WHERE Fname = "Jerry" AND Lname = "Prince" |
3,817 | <question>: How many Professors are in building NEB? <context>: CREATE TABLE Faculty (Rank VARCHAR, building VARCHAR) <answer>: SELECT COUNT(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB" |
3,818 | <question>: Show the first name and last name for all the instructors. <context>: CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, Rank VARCHAR) <answer>: SELECT fname, lname FROM Faculty WHERE Rank = "Instructor" |
3,819 | <question>: Show all the buildings along with the number of faculty members the buildings have. <context>: CREATE TABLE Faculty (building VARCHAR) <answer>: SELECT building, COUNT(*) FROM Faculty GROUP BY building |
3,820 | <question>: Which building has most faculty members? <context>: CREATE TABLE Faculty (building VARCHAR) <answer>: SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1 |
3,821 | <question>: Show all the buildings that have at least 10 professors. <context>: CREATE TABLE Faculty (building VARCHAR, rank VARCHAR) <answer>: SELECT building FROM Faculty WHERE rank = "Professor" GROUP BY building HAVING COUNT(*) >= 10 |
3,822 | <question>: For each faculty rank, show the number of faculty members who have it. <context>: CREATE TABLE Faculty (rank VARCHAR) <answer>: SELECT rank, COUNT(*) FROM Faculty GROUP BY rank |
3,823 | <question>: Show all the ranks and the number of male and female faculty for each rank. <context>: CREATE TABLE Faculty (rank VARCHAR, sex VARCHAR) <answer>: SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex |
3,824 | <question>: Which rank has the smallest number of faculty members? <context>: CREATE TABLE Faculty (rank VARCHAR) <answer>: SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1 |
3,825 | <question>: Show the number of male and female assistant professors. <context>: CREATE TABLE Faculty (sex VARCHAR, rank VARCHAR) <answer>: SELECT sex, COUNT(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex |
3,826 | <question>: What are the first name and last name of Linda Smith's advisor? <context>: CREATE TABLE Student (advisor VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR) <answer>: SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith" |
3,827 | <question>: Show the ids of students whose advisors are professors. <context>: CREATE TABLE Student (StuID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty (FacID VARCHAR, rank VARCHAR) <answer>: SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = "Professor" |
3,828 | <question>: Show first name and last name for all the students advised by Michael Goodrich. <context>: CREATE TABLE Faculty (FacID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Student (fname VARCHAR, lname VARCHAR, advisor VARCHAR) <answer>: SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = "Michael" AND T1.lname = "Goodrich" |
3,829 | <question>: Show the faculty id of each faculty member, along with the number of students he or she advises. <context>: CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) <answer>: SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID |
3,830 | <question>: Show all the faculty ranks and the number of students advised by each rank. <context>: CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (rank VARCHAR, FacID VARCHAR) <answer>: SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank |
3,831 | <question>: What are the first and last name of the faculty who has the most students? <context>: CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR) <answer>: SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1 |
3,832 | <question>: Show the ids for all the faculty members who have at least 2 students. <context>: CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) <answer>: SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2 |
3,833 | <question>: Show ids for the faculty members who don't advise any student. <context>: CREATE TABLE Faculty (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR) <answer>: SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student |
3,834 | <question>: What activities do we have? <context>: CREATE TABLE Activity (activity_name VARCHAR) <answer>: SELECT activity_name FROM Activity |
3,835 | <question>: How many activities do we have? <context>: CREATE TABLE Activity (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Activity |
3,836 | <question>: How many faculty members participate in an activity? <context>: CREATE TABLE Faculty_participates_in (FacID VARCHAR) <answer>: SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in |
3,837 | <question>: Show the ids of the faculty who don't participate in any activity. <context>: CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR) <answer>: SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in |
3,838 | <question>: Show the ids of all the faculty members who participate in an activity and advise a student. <context>: CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR, advisor VARCHAR) <answer>: SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student |
3,839 | <question>: How many activities does Mark Giuliano participate in? <context>: CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR) <answer>: SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" |
3,840 | <question>: Show the names of all the activities Mark Giuliano participates in. <context>: CREATE TABLE Activity (activity_name VARCHAR, actid VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR) <answer>: SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" |
3,841 | <question>: Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in. <context>: CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR) <answer>: SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID |
3,842 | <question>: Show all the activity names and the number of faculty involved in each activity. <context>: CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) <answer>: SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID |
3,843 | <question>: What is the first and last name of the faculty participating in the most activities? <context>: CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR) <answer>: SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1 |
3,844 | <question>: What is the name of the activity that has the most faculty members involved in? <context>: CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) <answer>: SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 |
3,845 | <question>: Show the ids of the students who don't participate in any activity. <context>: CREATE TABLE Participates_in (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) <answer>: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in |
3,846 | <question>: Show the ids for all the students who participate in an activity and are under 20. <context>: CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Participates_in (StuID VARCHAR, age INTEGER) <answer>: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20 |
3,847 | <question>: What is the first and last name of the student participating in the most activities? <context>: CREATE TABLE Student (fname VARCHAR, lname VARCHAR, StuID VARCHAR); CREATE TABLE Participates_in (StuID VARCHAR) <answer>: SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1 |
3,848 | <question>: What is the name of the activity with the most students? <context>: CREATE TABLE Participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) <answer>: SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 |
3,849 | <question>: Find the first names of the faculty members who are playing Canoeing or Kayaking. <context>: CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) <answer>: SELECT DISTINCT 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' OR T3.activity_name = 'Kayaking' |
3,850 | <question>: Find the first names of professors who are not playing Canoeing or Kayaking. <context>: CREATE TABLE faculty (lname VARCHAR, rank VARCHAR); CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) <answer>: SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT 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' OR T3.activity_name = 'Kayaking' |
3,851 | <question>: Find the first names of the faculty members who participate in Canoeing and Kayaking. <context>: CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) <answer>: 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' |
3,852 | <question>: Find the ids of the students who participate in Canoeing and Kayaking. <context>: CREATE TABLE activity (actid VARCHAR, activity_name VARCHAR); CREATE TABLE participates_in (stuid VARCHAR) <answer>: 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' |
3,853 | <question>: Find the name of the airport in the city of Goroka. <context>: CREATE TABLE airports (name VARCHAR, city VARCHAR) <answer>: SELECT name FROM airports WHERE city = 'Goroka' |
3,854 | <question>: Find the name, city, country, and altitude (or elevation) of the airports in the city of New York. <context>: CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) <answer>: SELECT name, city, country, elevation FROM airports WHERE city = 'New York' |
3,855 | <question>: How many airlines are there? <context>: CREATE TABLE airlines (Id VARCHAR) <answer>: SELECT COUNT(*) FROM airlines |
3,856 | <question>: How many airlines does Russia has? <context>: CREATE TABLE airlines (country VARCHAR) <answer>: SELECT COUNT(*) FROM airlines WHERE country = 'Russia' |
3,857 | <question>: What is the maximum elevation of all airports in the country of Iceland? <context>: CREATE TABLE airports (elevation INTEGER, country VARCHAR) <answer>: SELECT MAX(elevation) FROM airports WHERE country = 'Iceland' |
3,858 | <question>: Find the name of the airports located in Cuba or Argentina. <context>: CREATE TABLE airports (name VARCHAR, country VARCHAR) <answer>: SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' |
3,859 | <question>: Find the country of the airlines whose name starts with 'Orbit'. <context>: CREATE TABLE airlines (country VARCHAR, name VARCHAR) <answer>: SELECT country FROM airlines WHERE name LIKE 'Orbit%' |
3,860 | <question>: Find the name of airports whose altitude is between -50 and 50. <context>: CREATE TABLE airports (name VARCHAR, elevation INTEGER) <answer>: SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 |
3,861 | <question>: Which country is the airport that has the highest altitude located in? <context>: CREATE TABLE airports (country VARCHAR, elevation VARCHAR) <answer>: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 |
3,862 | <question>: Find the number of airports whose name contain the word 'International'. <context>: CREATE TABLE airports (name VARCHAR) <answer>: SELECT COUNT(*) FROM airports WHERE name LIKE '%International%' |
3,863 | <question>: How many different cities do have some airport in the country of Greenland? <context>: CREATE TABLE airports (city VARCHAR, country VARCHAR) <answer>: SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland' |
3,864 | <question>: Find the number of routes operated by American Airlines. <context>: CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) <answer>: SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
3,865 | <question>: Find the number of routes whose destination airports are in Canada. <context>: CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR) <answer>: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' |
3,866 | <question>: Find the name, city, and country of the airport that has the lowest altitude. <context>: CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) <answer>: SELECT name, city, country FROM airports ORDER BY elevation LIMIT 1 |
3,867 | <question>: Find the name, city, and country of the airport that has the highest latitude. <context>: CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) <answer>: SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1 |
3,868 | <question>: Find the name and city of the airport which is the destination of the most number of routes. <context>: CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (dst_apid VARCHAR) <answer>: 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 |
3,869 | <question>: Find the names of the top 10 airlines that operate the most number of routes. <context>: CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) <answer>: 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 |
3,870 | <question>: Find the name and city of the airport which is the source for the most number of flight routes. <context>: CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) <answer>: 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 |
3,871 | <question>: Find the number of different airports which are the destinations of the American Airlines. <context>: CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) <answer>: SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
3,872 | <question>: Which countries has the most number of airlines? <context>: CREATE TABLE airlines (country VARCHAR) <answer>: SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 |
3,873 | <question>: Which countries has the most number of airlines whose active status is 'Y'? <context>: CREATE TABLE airlines (country VARCHAR, active VARCHAR) <answer>: SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 |
3,874 | <question>: List all countries and their number of airlines in the descending order of number of airlines. <context>: CREATE TABLE airlines (country VARCHAR) <answer>: SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC |
3,875 | <question>: How many airports are there per country? Order the countries by decreasing number of airports. <context>: CREATE TABLE airports (country VARCHAR) <answer>: SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC |
3,876 | <question>: How many airports are there per city in the United States? Order the cities by decreasing number of airports. <context>: CREATE TABLE airports (city VARCHAR, country VARCHAR) <answer>: SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC |
3,877 | <question>: Return the cities with more than 3 airports in the United States. <context>: CREATE TABLE airports (city VARCHAR, country VARCHAR) <answer>: SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3 |
3,878 | <question>: How many cities are there that have more than 3 airports? <context>: CREATE TABLE airports (city VARCHAR) <answer>: SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3) |
3,879 | <question>: List the cities which have more than one airport and number of airports. <context>: CREATE TABLE airports (city VARCHAR) <answer>: SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1 |
3,880 | <question>: List the cities which have more than 2 airports sorted by the number of airports. <context>: CREATE TABLE airports (city VARCHAR) <answer>: SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) |
3,881 | <question>: Find the number of routes for each source airport and the airport name. <context>: CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) <answer>: SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name |
3,882 | <question>: Find the number of routes and airport name for each source airport, order the results by decreasing number of routes. <context>: CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) <answer>: 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 |
3,883 | <question>: Find the average elevation of all airports for each country. <context>: CREATE TABLE airports (country VARCHAR, elevation INTEGER) <answer>: SELECT AVG(elevation), country FROM airports GROUP BY country |
3,884 | <question>: Find the cities which have exactly two airports. <context>: CREATE TABLE airports (city VARCHAR) <answer>: SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2 |
3,885 | <question>: For each country and airline name, how many routes are there? <context>: CREATE TABLE airlines (country VARCHAR, name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) <answer>: 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 |
3,886 | <question>: Find the number of routes with destination airports in Italy. <context>: CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR) <answer>: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' |
3,887 | <question>: Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'. <context>: CREATE TABLE routes (dst_apid VARCHAR, alid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) <answer>: 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' |
3,888 | <question>: Find the number of routes that have destination John F Kennedy International Airport. <context>: CREATE TABLE airports (apid VARCHAR, name VARCHAR); CREATE TABLE routes (dst_apid VARCHAR) <answer>: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' |
3,889 | <question>: Find the number of routes from the United States to Canada. <context>: CREATE TABLE airports (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE routes (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR) <answer>: 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') |
3,890 | <question>: Find the id of routes whose source and destination airports are in the United States. <context>: CREATE TABLE routes (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE airports (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR) <answer>: 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') |
3,891 | <question>: Find the name of airline which runs the most number of routes. <context>: CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) <answer>: 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 |
3,892 | <question>: Find the busiest source airport that runs most number of routes in China. <context>: CREATE TABLE routes (src_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR) <answer>: 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 |
3,893 | <question>: Find the busiest destination airport that runs most number of routes in China. <context>: CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR) <answer>: 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 |
3,894 | <question>: What is the id of the most recent order? <context>: CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) <answer>: SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1 |
3,895 | <question>: what are the order id and customer id of the oldest order? <context>: CREATE TABLE orders (order_id VARCHAR, customer_id VARCHAR, date_order_placed VARCHAR) <answer>: SELECT order_id, customer_id FROM orders ORDER BY date_order_placed LIMIT 1 |
3,896 | <question>: Find the id of the order whose shipment tracking number is "3452". <context>: CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR) <answer>: SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" |
3,897 | <question>: Find the ids of all the order items whose product id is 11. <context>: CREATE TABLE order_items (order_item_id VARCHAR, product_id VARCHAR) <answer>: SELECT order_item_id FROM order_items WHERE product_id = 11 |
3,898 | <question>: List the name of all the distinct customers who have orders with status "Packing". <context>: CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) <answer>: 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" |
3,899 | <question>: Find the details of all the distinct customers who have orders with status "On Road". <context>: CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_details VARCHAR, customer_id VARCHAR) <answer>: 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" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.