query_id
int64
0
7k
database_id
stringclasses
140 values
table_id
sequencelengths
1
5
query
stringlengths
16
224
answer
stringlengths
18
577
difficulty
stringclasses
4 values
6,800
flight_4
[ "airports" ]
Find the name of the airport in the city of Goroka.
SELECT name FROM airports WHERE city = 'Goroka'
easy
6,801
flight_4
[ "airports" ]
What are the names of the airports in the city of Goroka?
SELECT name FROM airports WHERE city = 'Goroka'
easy
6,802
flight_4
[ "airports" ]
Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.
SELECT name , city , country , elevation FROM airports WHERE city = 'New York'
medium
6,803
flight_4
[ "airports" ]
What is the name, city, country, and elevation for every airport in the city of New York?
SELECT name , city , country , elevation FROM airports WHERE city = 'New York'
medium
6,804
flight_4
[ "airlines" ]
How many airlines are there?
SELECT count(*) FROM airlines
easy
6,805
flight_4
[ "airlines" ]
What is the total number of airlines?
SELECT count(*) FROM airlines
easy
6,806
flight_4
[ "airlines" ]
How many airlines does Russia has?
SELECT count(*) FROM airlines WHERE country = 'Russia'
easy
6,807
flight_4
[ "airlines" ]
What is the number of airlines based in Russia?
SELECT count(*) FROM airlines WHERE country = 'Russia'
easy
6,808
flight_4
[ "airports" ]
What is the maximum elevation of all airports in the country of Iceland?
SELECT max(elevation) FROM airports WHERE country = 'Iceland'
easy
6,809
flight_4
[ "airports" ]
What is the highest elevation of an airport in the country of Iceland?
SELECT max(elevation) FROM airports WHERE country = 'Iceland'
easy
6,810
flight_4
[ "airports" ]
Find the name of the airports located in Cuba or Argentina.
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
medium
6,811
flight_4
[ "airports" ]
What are the names of all airports in Cuba or Argentina?
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
medium
6,812
flight_4
[ "airlines" ]
Find the country of the airlines whose name starts with 'Orbit'.
SELECT country FROM airlines WHERE name LIKE 'Orbit%'
medium
6,813
flight_4
[ "airlines" ]
What are the countries of all airlines whose names start with Orbit?
SELECT country FROM airlines WHERE name LIKE 'Orbit%'
medium
6,814
flight_4
[ "airports" ]
Find the name of airports whose altitude is between -50 and 50.
SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
easy
6,815
flight_4
[ "airports" ]
What are the names of all airports whose elevation is between -50 and 50?
SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
easy
6,816
flight_4
[ "airports" ]
Which country is the airport that has the highest altitude located in?
SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
medium
6,817
flight_4
[ "airports" ]
What is the country of the airport with the highest elevation?
SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
medium
6,818
flight_4
[ "airports" ]
Find the number of airports whose name contain the word 'International'.
SELECT count(*) FROM airports WHERE name LIKE '%International%'
medium
6,819
flight_4
[ "airports" ]
How many airports' names have the word Interanation in them?
SELECT count(*) FROM airports WHERE name LIKE '%International%'
medium
6,820
flight_4
[ "airports" ]
How many different cities do have some airport in the country of Greenland?
SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland'
easy
6,821
flight_4
[ "airports" ]
In how many cities are there airports in the country of Greenland?
SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland'
easy
6,822
flight_4
[ "routes", "airlines" ]
Find the number of routes operated by American Airlines.
SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
medium
6,823
flight_4
[ "routes", "airlines" ]
How many routes does American Airlines operate?
SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
medium
6,824
flight_4
[ "airports", "routes" ]
Find the number of routes whose destination airports are in Canada.
SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'
medium
6,825
flight_4
[ "airports", "routes" ]
How many routes end in a Canadian airport?
SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'
medium
6,826
flight_4
[ "airports" ]
Find the name, city, and country of the airport that has the lowest altitude.
SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1
medium
6,827
flight_4
[ "airports" ]
What is the name, city, and country of the airport with the lowest altitude?
SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1
medium
6,828
flight_4
[ "airports" ]
Find the name, city, and country of the airport that has the highest latitude.
SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1
medium
6,829
flight_4
[ "airports" ]
What is the name, city, and country of the airport with the highest elevation?
SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1
medium
6,830
flight_4
[ "airports", "routes" ]
Find the name and city of the airport which is the destination of the most number of routes.
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
extra
6,831
flight_4
[ "airports", "routes" ]
What is the name and city of the airport that the most routes end at?
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
extra
6,832
flight_4
[ "routes", "airlines" ]
Find the names of the top 10 airlines that operate the most number of routes.
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
extra
6,833
flight_4
[ "routes", "airlines" ]
For the airline ids with the top 10 most routes operated, what are their names?
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
extra
6,834
flight_4
[ "airports", "routes" ]
Find the name and city of the airport which is the source for the most number of flight routes.
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
extra
6,835
flight_4
[ "airports", "routes" ]
What is the name and city of the airport from most of the routes start?
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
extra
6,836
flight_4
[ "routes", "airlines" ]
Find the number of different airports which are the destinations of the American Airlines.
SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
medium
6,837
flight_4
[ "routes", "airlines" ]
What is the number of different different airports that are destinations for American Airlines?
SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
medium
6,838
flight_4
[ "airlines" ]
Which countries has the most number of airlines?
SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1
hard
6,839
flight_4
[ "airlines" ]
What is the name of the country with the most number of home airlines?
SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1
hard
6,840
flight_4
[ "airlines" ]
Which countries has the most number of airlines whose active status is 'Y'?
SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1
extra
6,841
flight_4
[ "airlines" ]
What are the countries with the most airlines whose active status is Y?
SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1
extra
6,842
flight_4
[ "airlines" ]
List all countries and their number of airlines in the descending order of number of airlines.
SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC
extra
6,843
flight_4
[ "airlines" ]
How many airlines operate out of each country in descending order?
SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC
extra
6,844
flight_4
[ "airports" ]
How many airports are there per country? Order the countries by decreasing number of airports.
SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC
extra
6,845
flight_4
[ "airports" ]
What is the number of airports per country, ordered from most to least?
SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC
extra
6,846
flight_4
[ "airports" ]
How many airports are there per city in the United States? Order the cities by decreasing number of airports.
SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC
hard
6,847
flight_4
[ "airports" ]
How many airports are there per city in the US ordered from most to least?
SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC
hard
6,848
flight_4
[ "airports" ]
Return the cities with more than 3 airports in the United States.
SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3
medium
6,849
flight_4
[ "airports" ]
What is the number of cities in the United States with more than 3 airports?
SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3
medium
6,850
flight_4
[ "airports" ]
How many cities are there that have more than 3 airports?
SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3)
easy
6,851
flight_4
[ "airports" ]
What is the count of cities with more than 3 airports?
SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3)
easy
6,852
flight_4
[ "airports" ]
List the cities which have more than one airport and number of airports.
SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1
medium
6,853
flight_4
[ "airports" ]
What are the names of all cities with more than one airport and how many airports do they have?
SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1
medium
6,854
flight_4
[ "airports" ]
List the cities which have more than 2 airports sorted by the number of airports.
SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*)
medium
6,855
flight_4
[ "airports" ]
What are the cities that have more than 2 airports sorted by number of airports?
SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*)
medium
6,856
flight_4
[ "airports", "routes" ]
Find the number of routes for each source airport and the airport name.
SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name
medium
6,857
flight_4
[ "airports", "routes" ]
For each airport name, how many routes start at that airport?
SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name
medium
6,858
flight_4
[ "airports", "routes" ]
Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.
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
hard
6,859
flight_4
[ "airports", "routes" ]
For each airport name, how many routes start at that airport, ordered from most to least?
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
hard
6,860
flight_4
[ "airports" ]
Find the average elevation of all airports for each country.
SELECT avg(elevation) , country FROM airports GROUP BY country
medium
6,861
flight_4
[ "airports" ]
For each country, what is the average elevation of that country's airports?
SELECT avg(elevation) , country FROM airports GROUP BY country
medium
6,862
flight_4
[ "airports" ]
Find the cities which have exactly two airports.
SELECT city FROM airports GROUP BY city HAVING count(*) = 2
easy
6,863
flight_4
[ "airports" ]
What are the cities with exactly two airports?
SELECT city FROM airports GROUP BY city HAVING count(*) = 2
easy
6,864
flight_4
[ "routes", "airlines" ]
For each country and airline name, how many routes are there?
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
extra
6,865
flight_4
[ "routes", "airlines" ]
What is the total number of routes for each country and airline in that country?
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
extra
6,866
flight_4
[ "airports", "routes" ]
Find the number of routes with destination airports in Italy.
SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'
medium
6,867
flight_4
[ "airports", "routes" ]
What is the number of routes whose destinations are Italian airports?
SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'
medium
6,868
flight_4
[ "airports", "routes", "airlines" ]
Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.
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'
hard
6,869
flight_4
[ "airports", "routes", "airlines" ]
What is the number of routes operated by the airline American Airlines whose destinations are in Italy?
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'
hard
6,870
flight_4
[ "airports", "routes" ]
Find the number of routes that have destination John F Kennedy International Airport.
SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
medium
6,871
flight_4
[ "airports", "routes" ]
What is the number of routes that end at John F Kennedy International Airport?
SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
medium
6,872
flight_4
[ "airports", "routes" ]
Find the number of routes from the United States to Canada.
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')
extra
6,873
flight_4
[ "airports", "routes" ]
How many routes go from the United States to Canada?
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')
extra
6,874
flight_4
[ "airports", "routes" ]
Find the id of routes whose source and destination airports are in the United States.
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')
extra
6,875
flight_4
[ "airports", "routes" ]
What is the id of the routes whose source and destination airports are in the United States?
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')
extra
6,876
flight_4
[ "routes", "airlines" ]
Find the name of airline which runs the most number of routes.
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
extra
6,877
flight_4
[ "routes", "airlines" ]
What is the name of the airline with the most routes?
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
extra
6,878
flight_4
[ "airports", "routes" ]
Find the busiest source airport that runs most number of routes in China.
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
extra
6,879
flight_4
[ "airports", "routes" ]
What is the name of the airport with the most number of routes that start in China?
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
extra
6,880
flight_4
[ "airports", "routes" ]
Find the busiest destination airport that runs most number of routes in China.
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
extra
6,881
flight_4
[ "airports", "routes" ]
What is the name of the airport that is the destination of the most number of routes that start in China?
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
extra
6,882
tracking_orders
[ "orders" ]
What is the id of the most recent order?
SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
medium
6,883
tracking_orders
[ "orders" ]
Find the id of the order made most recently.
SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
medium
6,884
tracking_orders
[ "orders" ]
what are the order id and customer id of the oldest order?
SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1
medium
6,885
tracking_orders
[ "orders" ]
Find the order id and customer id associated with the oldest order.
SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1
medium
6,886
tracking_orders
[ "shipments" ]
Find the id of the order whose shipment tracking number is "3452".
SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"
easy
6,887
tracking_orders
[ "shipments" ]
Which order's shipment tracking number is "3452"? Give me the id of the order.
SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"
easy
6,888
tracking_orders
[ "order_items" ]
Find the ids of all the order items whose product id is 11.
SELECT order_item_id FROM order_items WHERE product_id = 11
easy
6,889
tracking_orders
[ "order_items" ]
Find all the order items whose product id is 11. What are the order item ids?
SELECT order_item_id FROM order_items WHERE product_id = 11
easy
6,890
tracking_orders
[ "orders", "customers" ]
List the name of all the distinct customers who have orders with status "Packing".
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"
medium
6,891
tracking_orders
[ "orders", "customers" ]
Which customers have orders with status "Packing"? Give me the customer names.
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"
medium
6,892
tracking_orders
[ "orders", "customers" ]
Find the details of all the distinct customers who have orders with status "On Road".
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"
medium
6,893
tracking_orders
[ "orders", "customers" ]
What are the distinct customers who have orders with status "On Road"? Give me the customer details?
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"
medium
6,894
tracking_orders
[ "orders", "customers" ]
What is the name of the customer who has the most 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
extra
6,895
tracking_orders
[ "orders", "customers" ]
Which customer made the most orders? Find the customer name.
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
extra
6,896
tracking_orders
[ "orders", "customers" ]
What is the customer id of the customer who has the most 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
extra
6,897
tracking_orders
[ "orders", "customers" ]
Find the id of the customer who made the most 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
extra
6,898
tracking_orders
[ "orders", "customers" ]
Give me a list of id and status of orders which belong to the customer named "Jeramie".
SELECT T2.order_id , T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
medium
6,899
tracking_orders
[ "orders", "customers" ]
Which orders are made by the customer named "Jeramie"? Give me the order ids and status.
SELECT T2.order_id , T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
medium