db_id
stringclasses
40 values
query
stringlengths
22
608
question
stringlengths
22
185
pilot_1
SELECT pilot_name FROM PilotSkills WHERE age < (SELECT avg(age) FROM PilotSkills) ORDER BY age
Return the names of pilots who are younger than average, ordered by age ascending.
pilot_1
SELECT * FROM PilotSkills WHERE age < 30
Find all information of on pilots whose age is less than 30.
pilot_1
select * from pilotskills where age < 30
What is all the information about pilots who are younger than 30 ?
pilot_1
SELECT pilot_name FROM PilotSkills WHERE age < 35 AND plane_name = 'Piper Cub'
Find the names of all pilots who have a plane named Piper Cub and is under 35.
pilot_1
SELECT pilot_name FROM PilotSkills WHERE age < 35 AND plane_name = 'Piper Cub'
What are the names of pilots who are younger than 35 and have a plane named Piper Cub?
pilot_1
SELECT LOCATION FROM hangar WHERE plane_name = 'F-14 Fighter'
Where is the plane F-14 Fighter located?
pilot_1
SELECT LOCATION FROM hangar WHERE plane_name = 'F-14 Fighter'
Return the location of the hangar in which F-14 Fighter is located.
pilot_1
SELECT count(DISTINCT LOCATION) FROM hangar
How many different places have some plane?
pilot_1
SELECT count(DISTINCT LOCATION) FROM hangar
Count the number of different locations of hangars.
pilot_1
SELECT plane_name FROM pilotskills WHERE pilot_name = 'Jones' AND age = 32
Which plane does the pilot Jones with age 32 has?
pilot_1
SELECT plane_name FROM pilotskills WHERE pilot_name = 'Jones' AND age = 32
What are the names of planes that the pilot Jones who is 32 has?
pilot_1
SELECT count(*) FROM pilotskills WHERE age > 40
How many pilots who are older than 40?
pilot_1
SELECT count(*) FROM pilotskills WHERE age > 40
Count the number of pilots with age greater than 40.
pilot_1
SELECT count(*) FROM pilotskills WHERE age < 35 AND plane_name = 'B-52 Bomber'
How many plane B-52 Bomber owned by the pilot who is under 35?
pilot_1
SELECT count(*) FROM pilotskills WHERE age < 35 AND plane_name = 'B-52 Bomber'
Count the number of B-52 Bombers owned by pilots under 35.
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' ORDER BY age LIMIT 1
Who is the youngest pilot to fly the plane Piper Cub?
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' ORDER BY age LIMIT 1
Return the name of the youngest pilot to fly Piper Cub.
pilot_1
SELECT plane_name FROM pilotskills GROUP BY plane_name ORDER BY count(*) DESC LIMIT 1
What is the name of the most popular plane?
pilot_1
SELECT plane_name FROM pilotskills GROUP BY plane_name ORDER BY count(*) DESC LIMIT 1
What is the name of the plane that is flown the most often?
pilot_1
SELECT plane_name FROM pilotskills GROUP BY plane_name ORDER BY count(*) LIMIT 1
What is the name of the least popular plane?
pilot_1
SELECT plane_name FROM pilotskills GROUP BY plane_name ORDER BY count(*) LIMIT 1
What is the name of the plane that is flown the least often?
pilot_1
SELECT count(DISTINCT T1.pilot_name) FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.location = 'Chicago'
How many pilots whose planes are in Chicago?
pilot_1
SELECT count(DISTINCT T1.pilot_name) FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.location = 'Chicago'
Count the number of pilots who have planes in Chicago.
pilot_1
SELECT plane_name FROM pilotskills WHERE pilot_name = 'Smith' AND age = 41
What are the planes owned by pilot Smith with age 41?
pilot_1
SELECT plane_name FROM pilotskills WHERE pilot_name = 'Smith' AND age = 41
Return the names of planes owned by the pilot whose name is Smith and is 41 years old.
pilot_1
SELECT count(DISTINCT plane_name) FROM pilotskills
How many distinct planes are owned across all pilots?
pilot_1
SELECT count(DISTINCT plane_name) FROM pilotskills
Count the number of different plane names across all pilots.
pilot_1
SELECT count(plane_name) FROM pilotskills WHERE pilot_name = 'Smith'
How many planes are owned by the pilot whose name is Smith?
pilot_1
SELECT count(plane_name) FROM pilotskills WHERE pilot_name = 'Smith'
Count the number of planes Smith owns.
pilot_1
SELECT count(plane_name) FROM pilotskills WHERE age > 40
How many planes are controlled by the pilots whose age is older than 40?
pilot_1
SELECT count(plane_name) FROM pilotskills WHERE age > 40
Count the number of planes flown by pilots older than 40.
pilot_1
SELECT pilot_name FROM pilotskills WHERE age BETWEEN 30 AND 40 ORDER BY age
Find the names of all pilots with age between 30 and 40 sorted by their ages in ascending order.
pilot_1
SELECT pilot_name FROM pilotskills WHERE age BETWEEN 30 AND 40 ORDER BY age
What are the names of pilots between the ages of 30 and 40, ordered by age ascending?
pilot_1
SELECT pilot_name FROM pilotskills ORDER BY age DESC
List all pilot names sorted by their ages in the descending order.
pilot_1
SELECT pilot_name FROM pilotskills ORDER BY age DESC
What are the names of pilots, ordered by age descending?
pilot_1
SELECT LOCATION FROM hangar ORDER BY plane_name
Find all locations of planes sorted by the plane name.
pilot_1
SELECT LOCATION FROM hangar ORDER BY plane_name
What are the locations of the different planes, ordered by plane name?
pilot_1
SELECT DISTINCT plane_name FROM pilotskills ORDER BY plane_name
List all distinct types of planes owned by all pilots in alphabetic order?
pilot_1
SELECT DISTINCT plane_name FROM pilotskills ORDER BY plane_name
What are the different plane names, ordered alphabetically?
pilot_1
SELECT count(pilot_name) FROM pilotskills ORDER BY age > 40 OR age < 30
How many pilots who are older than 40 or younger than 30?
pilot_1
SELECT count(pilot_name) FROM pilotskills ORDER BY age > 40 OR age < 30
Count the number of pilots with age greater than 40 or less than 30.
pilot_1
SELECT pilot_name , age FROM pilotskills WHERE plane_name = 'Piper Cub' AND age > 35 UNION SELECT pilot_name , age FROM pilotskills WHERE plane_name = 'F-14 Fighter' AND age < 30
What are the names and ages of pilots who own plane Piper Cub and are older than 35, or have F-14 Fighter and are younger than 30?
pilot_1
SELECT pilot_name , age FROM pilotskills WHERE plane_name = 'Piper Cub' AND age > 35 UNION SELECT pilot_name , age FROM pilotskills WHERE plane_name = 'F-14 Fighter' AND age < 30
Return the names and ages of pilors who have flown Piper Cub and are older than 35, or have flown the F-14 Fighter and are younger than 30.
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' EXCEPT SELECT pilot_name FROM pilotskills WHERE plane_name = 'B-52 Bomber'
Find pilots who own plane Piper Cub but not B-52 Bomber.
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' EXCEPT SELECT pilot_name FROM pilotskills WHERE plane_name = 'B-52 Bomber'
What are the names of pilots who have flown Piper Cub but not the B-52 Bomber?
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' INTERSECT SELECT pilot_name FROM pilotskills WHERE plane_name = 'B-52 Bomber'
Find pilots who own planes Piper Cub and B-52 Bomber.
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' INTERSECT SELECT pilot_name FROM pilotskills WHERE plane_name = 'B-52 Bomber'
What are the names of pilots who own both Piper Cub and the B-52 Bomber?
pilot_1
SELECT avg(age) , min(age) FROM pilotskills
What are the average and smallest ages of all pilots?
pilot_1
SELECT avg(age) , min(age) FROM pilotskills
Return the average and minimum ages across all pilots.
pilot_1
SELECT T1.pilot_name FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.location = "Austin" INTERSECT SELECT T1.pilot_name FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.LOCATION = "Boston"
What are the names of pilots who have planes in both Austin and Boston?
pilot_1
SELECT T1.pilot_name FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.location = "Austin" INTERSECT SELECT T1.pilot_name FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.LOCATION = "Boston"
Give the names of pilots who have planes in Austin and Boston.
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' OR plane_name = 'F-14 Fighter'
Find the pilots who have either plane Piper Cub or plane F-14 Fighter.
pilot_1
SELECT pilot_name FROM pilotskills WHERE plane_name = 'Piper Cub' OR plane_name = 'F-14 Fighter'
What are the names of pilots who have either the Piper Cub or the F-14 Fighter?
pilot_1
SELECT avg(age) , plane_name FROM pilotskills GROUP BY plane_name
What is the average age of pilots for different types of planes?
pilot_1
SELECT avg(age) , plane_name FROM pilotskills GROUP BY plane_name
Return the average age of pilots for each plane name.
pilot_1
SELECT count(*) , plane_name FROM pilotskills GROUP BY plane_name
Find the number of planes for each type.
pilot_1
SELECT count(*) , plane_name FROM pilotskills GROUP BY plane_name
Count the number of entries for each plane name.
pilot_1
SELECT pilot_name , plane_name , max(age) FROM pilotskills GROUP BY plane_name ORDER BY plane_name
Find the name of the oldest pilot for each type of plane, and order the results by plane name.
pilot_1
SELECT pilot_name , plane_name , max(age) FROM pilotskills GROUP BY plane_name ORDER BY plane_name
What are the different plane names, and what are the names of the oldest pilot who has each, ordered by plane name?
pilot_1
SELECT pilot_name , plane_name , max(age) FROM pilotskills GROUP BY plane_name
What are the names of oldest pilots for each type of plane?
pilot_1
SELECT pilot_name , plane_name , max(age) FROM pilotskills GROUP BY plane_name
Return the names of the different planes, as well as the names of the oldest pilots who flew each.
pilot_1
SELECT max(age) , pilot_name FROM pilotskills GROUP BY pilot_name
Find the max age for each group of pilots with the same name.
pilot_1
SELECT max(age) , pilot_name FROM pilotskills GROUP BY pilot_name
What are the different pilot names, and what are the maximum ages of pilots for each?
pilot_1
SELECT count(T1.pilot_name) , avg(T1.age) , T2.location FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name GROUP BY T2.location
For each city, find the number and average age of pilots who have a plane.
pilot_1
SELECT count(T1.pilot_name) , avg(T1.age) , T2.location FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name GROUP BY T2.location
What are the different hangar locations and how many pilots correspond to each. Also, what are their average ages?
pilot_1
SELECT count(*) , plane_name FROM pilotskills GROUP BY plane_name HAVING avg(age) < 35
Find the number of pilots for the plane types with average pilot age below 35.
pilot_1
SELECT count(*) , plane_name FROM pilotskills GROUP BY plane_name HAVING avg(age) < 35
What are the different plane names of planes with an average pilot age of below 35, and how many pilots have flown each of them?
pilot_1
SELECT T2.location FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T1.age = (SELECT min(age) FROM pilotskills)
Find the location of the plane that is owned by the youngest pilot.
pilot_1
SELECT T2.location FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T1.age = (SELECT min(age) FROM pilotskills)
What is the location of the plane that was flown by the pilot with the lowest age?
pilot_1
SELECT T1.pilot_name , T1.age FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.location = "Austin"
Find the name and age of pilots who have a plane in Austin.
pilot_1
SELECT T1.pilot_name , T1.age FROM pilotskills AS T1 JOIN hangar AS T2 ON T1.plane_name = T2.plane_name WHERE T2.location = "Austin"
What are the names and ages of pilots who have planes located in Austin?
pilot_1
SELECT pilot_name FROM pilotskills WHERE age > (SELECT min(age) FROM pilotskills WHERE plane_name = 'Piper Cub') ORDER BY pilot_name
List in alphabetic order the names of pilots whose age is greater than some pilots having plane Piper Cub.
pilot_1
SELECT pilot_name FROM pilotskills WHERE age > (SELECT min(age) FROM pilotskills WHERE plane_name = 'Piper Cub') ORDER BY pilot_name
Return the names of pilots who are older than any pilot who has flown Piper Cub, ordered alphabetically.
pilot_1
SELECT count(*) FROM pilotskills WHERE age < (SELECT min(age) FROM pilotskills WHERE plane_name = 'F-14 Fighter')
Find the number of pilots whose age is younger than all pilots whose plane is F-14 Fighter.
pilot_1
SELECT count(*) FROM pilotskills WHERE age < (SELECT min(age) FROM pilotskills WHERE plane_name = 'F-14 Fighter')
How many pilots are younger than all pilots who own the F-14 Fighter?
pilot_1
SELECT DISTINCT plane_name FROM pilotskills WHERE plane_name LIKE '%Bomber%'
Find all different planes whose names contain substring 'Bomber'.
pilot_1
SELECT DISTINCT plane_name FROM pilotskills WHERE plane_name LIKE '%Bomber%'
What are the different plane names that contain the word Bomber?
pilot_1
SELECT count(pilot_name) FROM pilotskills WHERE age > (SELECT min(age) FROM pilotskills WHERE plane_name = 'Piper Cub')
Find the number of all pilots whose age is older than some pilot who has plane Piper Cub.
pilot_1
SELECT count(pilot_name) FROM pilotskills WHERE age > (SELECT min(age) FROM pilotskills WHERE plane_name = 'Piper Cub')
How many pilots are older than the youngest pilot who has Piper Cub?
district_spokesman
SELECT name FROM district ORDER BY Area_km DESC LIMIT 1
Find the name of the district which has the largest area.
district_spokesman
SELECT area_km , Government_website FROM district ORDER BY Population LIMIT 1
Select the area and government website of the district with the smallest population.
district_spokesman
SELECT name , population FROM district WHERE area_km > (SELECT avg(area_km) FROM district)
Find the names and populations of the districts whose area is greater than the average area.
district_spokesman
SELECT max(area_km) , avg(area_km) FROM district
Give me the biggest and average areas of all districts.
district_spokesman
SELECT sum(population) FROM district ORDER BY area_km DESC LIMIT 3
What is the total population of the districts whose areas are in the top 3?
district_spokesman
SELECT name , Government_website , district_id FROM district ORDER BY Population
List the ids, names, and government websites of all districts sorted by population.
district_spokesman
SELECT name FROM district WHERE Government_website LIKE "%gov%"
Find the names of districts whose government links use a 'gov' domain.
district_spokesman
SELECT district_id , name FROM district WHERE area_km > 3000 OR population > 4000
Return the ids and names of the districts whose population is larger than 4000 or area bigger than 3000.
district_spokesman
SELECT name , speach_title FROM spokesman
Find all spokesman's names and speech titles.
district_spokesman
SELECT avg(points) , avg(age) FROM spokesman WHERE rank_position = 1
Find the average points and average ages of all spokesmen whose rank position is 1.
district_spokesman
SELECT name , points FROM spokesman WHERE age < 40
What are the names and points of spokesmen who are younger than 40?
district_spokesman
SELECT name FROM spokesman ORDER BY age DESC LIMIT 1
Who is the oldest spokesman?
district_spokesman
SELECT name FROM spokesman WHERE points < (SELECT avg(points) FROM spokesman)
Which spokesman has lower points than the average?
district_spokesman
SELECT t1.name FROM district AS t1 JOIN spokesman_district AS t2 ON t1.District_ID = t2.District_ID GROUP BY t2.District_ID ORDER BY count(*) DESC LIMIT 1
Find the name of the district which has greatest number of spokesmen.
district_spokesman
SELECT t1.name FROM spokesman AS t1 JOIN spokesman_district AS t2 ON t1.Spokesman_ID = t2.Spokesman_ID WHERE t2.start_year < 2004
Find the names of spokesmen who have served some district before 2004.
district_spokesman
SELECT t1.name , count(*) FROM district AS t1 JOIN spokesman_district AS t2 ON t1.District_ID = t2.District_ID GROUP BY t2.District_ID
Find the number of spokesmen for each district, and the show district names as well.
district_spokesman
SELECT t3.name FROM spokesman AS t1 JOIN spokesman_district AS t2 ON t1.Spokesman_ID = t2.Spokesman_ID JOIN district AS t3 ON t3.district_id = t2.district_id WHERE t1.rank_position = 1 INTERSECT SELECT t3.name FROM spokesman AS t1 JOIN spokesman_district AS t2 ON t1.Spokesman_ID = t2.Spokesman_ID JOIN district AS t3 ON t3.district_id = t2.district_id WHERE t1.rank_position = 2
Find the names of the districts which have had both spokesman with rank position 1 and 2.
district_spokesman
SELECT t1.name FROM district AS t1 JOIN spokesman_district AS t2 ON t1.District_ID = t2.District_ID GROUP BY t2.District_ID HAVING count(*) > 1
Find the names of districts which have more than one spokesman.
district_spokesman
SELECT count(*) FROM district WHERE district_id NOT IN (SELECT district_id FROM spokesman_district)
Find the number of districts which have no spokesmen.
district_spokesman
SELECT name FROM spokesman WHERE Spokesman_ID NOT IN (SELECT Spokesman_ID FROM spokesman_district)
Find the name of spokesmen who do not speak for any district.
district_spokesman
SELECT sum(population) , avg(population) FROM district WHERE district_id IN (SELECT district_id FROM spokesman_district)
Find the total and average population of the districts which have some spokesman.