db_id
stringclasses
20 values
question
stringlengths
18
174
db_info
stringclasses
20 values
ground_truth
stringlengths
20
474
flight_2
Return the name of the airport with code 'AKO'.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airportname from airports where airportcode = 'AKO'
flight_2
What are airport names at City 'Aberdeen'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airportname from airports where city = 'Aberdeen'
flight_2
What are the names of airports in Aberdeen?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airportname from airports where city = 'Aberdeen'
flight_2
How many flights depart from 'APG'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights where sourceairport = 'APG'
flight_2
Count the number of flights departing from 'APG'.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights where sourceairport = 'APG'
flight_2
How many flights have destination ATO?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights where destairport = 'ATO'
flight_2
Count the number of flights into ATO.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights where destairport = 'ATO'
flight_2
How many flights depart from City Aberdeen?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.sourceairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
Return the number of flights departing from Aberdeen.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.sourceairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
How many flights arriving in Aberdeen city?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
Return the number of flights arriving in Aberdeen.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
How many flights depart from City 'Aberdeen' and have destination City 'Ashley'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode join airports on flights.sourceairport = airports.airportcode where airports.city = 'Ashley' and airports.city = 'Aberdeen'
flight_2
How many flights fly from Aberdeen to Ashley?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode join airports on flights.sourceairport = airports.airportcode where airports.city = 'Ashley' and airports.city = 'Aberdeen'
flight_2
How many flights does airline 'JetBlue Airways' have?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airlines on flights.airline = airlines.uid where airlines.airline = 'JetBlue Airways'
flight_2
Give the number of Jetblue Airways flights.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airlines on flights.airline = airlines.uid where airlines.airline = 'JetBlue Airways'
flight_2
How many 'United Airlines' flights go to Airport 'ASY'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from airlines join flights on flights.airline = airlines.uid where airlines.airline = 'United Airlines' and flights.destairport = 'ASY'
flight_2
Count the number of United Airlines flights arriving in ASY Airport.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from airlines join flights on flights.airline = airlines.uid where airlines.airline = 'United Airlines' and flights.destairport = 'ASY'
flight_2
How many 'United Airlines' flights depart from Airport 'AHD'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from airlines join flights on flights.airline = airlines.uid where airlines.airline = 'United Airlines' and flights.sourceairport = 'AHD'
flight_2
Return the number of United Airlines flights leaving from AHD Airport.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from airlines join flights on flights.airline = airlines.uid where airlines.airline = 'United Airlines' and flights.sourceairport = 'AHD'
flight_2
How many United Airlines flights go to City 'Aberdeen'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode join airlines on airlines.uid = flights.airline where airports.city = 'Aberdeen' and airlines.airline = 'United Airlines'
flight_2
Count the number of United Airlines flights that arrive in Aberdeen.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode join airlines on airlines.uid = flights.airline where airports.city = 'Aberdeen' and airlines.airline = 'United Airlines'
flight_2
Which city has most number of arriving flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.city from airports join flights on airports.airportcode = flights.destairport group by airports.city order by count ( * ) desc limit 1
flight_2
Which city has the most frequent destination airport?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.city from airports join flights on airports.airportcode = flights.destairport group by airports.city order by count ( * ) desc limit 1
flight_2
Which city has most number of departing flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.city from airports join flights on airports.airportcode = flights.sourceairport group by airports.city order by count ( * ) desc limit 1
flight_2
Which city is the most frequent source airport?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.city from airports join flights on airports.airportcode = flights.sourceairport group by airports.city order by count ( * ) desc limit 1
flight_2
What is the code of airport that has the highest number of flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.airportcode from airports join flights on airports.airportcode = flights.destairport or airports.airportcode = flights.sourceairport group by airports.airportcode order by count ( * ) desc limit 1
flight_2
What is the airport code of the airport with the most flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.airportcode from airports join flights on airports.airportcode = flights.destairport or airports.airportcode = flights.sourceairport group by airports.airportcode order by count ( * ) desc limit 1
flight_2
What is the code of airport that has fewest number of flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.airportcode from airports join flights on airports.airportcode = flights.destairport or airports.airportcode = flights.sourceairport group by airports.airportcode order by count ( * ) asc limit 1
flight_2
Give the code of the airport with the least flights.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airports.airportcode from airports join flights on airports.airportcode = flights.destairport or airports.airportcode = flights.sourceairport group by airports.airportcode order by count ( * ) asc limit 1
flight_2
Which airline has most number of flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline group by airlines.airline order by count ( * ) desc limit 1
flight_2
What airline serves the most flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline group by airlines.airline order by count ( * ) desc limit 1
flight_2
Find the abbreviation and country of the airline that has fewest number of flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.abbreviation , airlines.country from airlines join flights on airlines.uid = flights.airline group by airlines.airline order by count ( * ) asc limit 1
flight_2
What is the abbreviation of the airilne has the fewest flights and what country is it in?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.abbreviation , airlines.country from airlines join flights on airlines.uid = flights.airline group by airlines.airline order by count ( * ) asc limit 1
flight_2
What are airlines that have some flight departing from airport 'AHD'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'AHD'
flight_2
Which airlines have a flight with source airport AHD?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'AHD'
flight_2
What are airlines that have flights arriving at airport 'AHD'?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.destairport = 'AHD'
flight_2
Which airlines have a flight with destination airport AHD?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.destairport = 'AHD'
flight_2
Find all airlines that have flights from both airports 'APG' and 'CVO'.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'APG' intersect select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'CVO'
flight_2
Which airlines have departing flights from both APG and CVO airports?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'APG' intersect select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'CVO'
flight_2
Find all airlines that have flights from airport 'CVO' but not from 'APG'.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'CVO' except select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'APG'
flight_2
Which airlines have departures from CVO but not from APG airports?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'CVO' except select airlines.airline from airlines join flights on airlines.uid = flights.airline where flights.sourceairport = 'APG'
flight_2
Find all airlines that have at least 10 flights.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline group by airlines.airline having count ( * ) > 10
flight_2
Which airlines have at least 10 flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline group by airlines.airline having count ( * ) > 10
flight_2
Find all airlines that have fewer than 200 flights.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline group by airlines.airline having count ( * ) < 200
flight_2
Which airlines have less than 200 flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airlines.airline from airlines join flights on airlines.uid = flights.airline group by airlines.airline having count ( * ) < 200
flight_2
What are flight numbers of Airline "United Airlines"?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flights.flightno from flights join airlines on airlines.uid = flights.airline where airlines.airline = 'United Airlines'
flight_2
Which flight numbers correspond to United Airlines flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flights.flightno from flights join airlines on airlines.uid = flights.airline where airlines.airline = 'United Airlines'
flight_2
What are flight numbers of flights departing from Airport "APG"?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flightno from flights where sourceairport = 'APG'
flight_2
Give the flight numbers of flights leaving from APG.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flightno from flights where sourceairport = 'APG'
flight_2
What are flight numbers of flights arriving at Airport "APG"?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flightno from flights where destairport = 'APG'
flight_2
Give the flight numbers of flights landing at APG.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flightno from flights where destairport = 'APG'
flight_2
What are flight numbers of flights departing from City "Aberdeen "?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flights.flightno from flights join airports on flights.sourceairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
Give the flight numbers of flights leaving from Aberdeen.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flights.flightno from flights join airports on flights.sourceairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
What are flight numbers of flights arriving at City "Aberdeen"?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flights.flightno from flights join airports on flights.destairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
Give the flight numbers of flights arriving in Aberdeen.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select flights.flightno from flights join airports on flights.destairport = airports.airportcode where airports.city = 'Aberdeen'
flight_2
Find the number of flights landing in the city of Aberdeen or Abilene.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode where airports.city = 'Aberdeen' or airports.city = 'Abilene'
flight_2
How many flights land in Aberdeen or Abilene?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select count ( * ) from flights join airports on flights.destairport = airports.airportcode where airports.city = 'Aberdeen' or airports.city = 'Abilene'
flight_2
Find the name of airports which do not have any flight in and out.
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airportname from airports where airportcode not in ( select sourceairport from flights union select destairport from flights )
flight_2
Which airports do not have departing or arriving flights?
# airlines ( uid , airline , abbreviation , country ) # airports ( city , airportcode , airportname , country , countryabbrev ) # flights ( airline , flightno , sourceairport , destairport ) # flights.destairport = airports.airportcode # flights.sourceairport = airports.airportcode
select airportname from airports where airportcode not in ( select sourceairport from flights union select destairport from flights )
employee_hire_evaluation
How many employees are there?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) from employee
employee_hire_evaluation
Count the number of employees
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) from employee
employee_hire_evaluation
Sort employee names by their age in ascending order.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from employee order by age asc
employee_hire_evaluation
List the names of employees and sort in ascending order of age.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from employee order by age asc
employee_hire_evaluation
What is the number of employees from each city?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) , city from employee group by city
employee_hire_evaluation
Count the number of employees for each city.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) , city from employee group by city
employee_hire_evaluation
Which cities do more than one employee under age 30 come from?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select city from employee where age < 30 group by city having count ( * ) > 1
employee_hire_evaluation
Find the cities that have more than one employee under age 30.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select city from employee where age < 30 group by city having count ( * ) > 1
employee_hire_evaluation
Find the number of shops in each location.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) , location from shop group by location
employee_hire_evaluation
How many shops are there in each location?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) , location from shop group by location
employee_hire_evaluation
Find the manager name and district of the shop whose number of products is the largest.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select manager_name , district from shop order by number_products desc limit 1
employee_hire_evaluation
What are the manager name and district of the shop that sells the largest number of products?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select manager_name , district from shop order by number_products desc limit 1
employee_hire_evaluation
find the minimum and maximum number of products of all stores.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select min ( number_products ) , max ( number_products ) from shop
employee_hire_evaluation
What are the minimum and maximum number of products across all the shops?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select min ( number_products ) , max ( number_products ) from shop
employee_hire_evaluation
Return the name, location and district of all shops in descending order of number of products.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name , location , district from shop order by number_products desc
employee_hire_evaluation
Sort all the shops by number products in descending order, and return the name, location and district of each shop.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name , location , district from shop order by number_products desc
employee_hire_evaluation
Find the names of stores whose number products is more than the average number of products.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from shop where number_products > ( select avg ( number_products ) from shop )
employee_hire_evaluation
Which shops' number products is above the average? Give me the shop names.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from shop where number_products > ( select avg ( number_products ) from shop )
employee_hire_evaluation
find the name of employee who was awarded the most times in the evaluation.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id group by evaluation.employee_id order by count ( * ) desc limit 1
employee_hire_evaluation
Which employee received the most awards in evaluations? Give me the employee name.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id group by evaluation.employee_id order by count ( * ) desc limit 1
employee_hire_evaluation
Find the name of the employee who got the highest one time bonus.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id order by evaluation.bonus desc limit 1
employee_hire_evaluation
Which employee received the biggest bonus? Give me the employee name.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id order by evaluation.bonus desc limit 1
employee_hire_evaluation
Find the names of employees who never won any award in the evaluation.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from employee where employee_id not in ( select employee_id from evaluation )
employee_hire_evaluation
What are the names of the employees who never received any evaluation?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from employee where employee_id not in ( select employee_id from evaluation )
employee_hire_evaluation
What is the name of the shop that is hiring the largest number of employees?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by hiring.shop_id order by count ( * ) desc limit 1
employee_hire_evaluation
Which shop has the most employees? Give me the shop name.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by hiring.shop_id order by count ( * ) desc limit 1
employee_hire_evaluation
Find the name of the shops that do not hire any employee.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from shop where shop_id not in ( select shop_id from hiring )
employee_hire_evaluation
Which shops run with no employees? Find the shop names
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select name from shop where shop_id not in ( select shop_id from hiring )
employee_hire_evaluation
Find the number of employees hired in each shop; show the shop name as well.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) , shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by shop.name
employee_hire_evaluation
For each shop, return the number of employees working there and the name of the shop.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( * ) , shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by shop.name
employee_hire_evaluation
What is total bonus given in all evaluations?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select sum ( bonus ) from evaluation
employee_hire_evaluation
Find the total amount of bonus given in all the evaluations.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select sum ( bonus ) from evaluation
employee_hire_evaluation
Give me all the information about hiring.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select * from hiring
employee_hire_evaluation
What is all the information about hiring?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select * from hiring
employee_hire_evaluation
Which district has both stores with less than 3000 products and stores with more than 10000 products?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select district from shop where number_products < 3000 intersect select district from shop where number_products > 10000
employee_hire_evaluation
Find the districts in which there are both shops selling less than 3000 products and shops selling more than 10000 products.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select district from shop where number_products < 3000 intersect select district from shop where number_products > 10000
employee_hire_evaluation
How many different store locations are there?
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( distinct location ) from shop
employee_hire_evaluation
Count the number of distinct store locations.
# employee ( employee_id , name , age , city ) # shop ( shop_id , name , location , district , number_products , manager_name ) # hiring ( shop_id , employee_id , start_from , is_full_time ) # evaluation ( employee_id , year_awarded , bonus ) # hiring.employee_id = employee.employee_id # hiring.shop_id = shop.shop_id # evaluation.employee_id = employee.employee_id
select count ( distinct location ) from shop
cre_Doc_Template_Mgt
How many documents do we have?
# ref_template_types ( template_type_code , template_type_description ) # templates ( template_id , version_number , template_type_code , date_effective_from , date_effective_to , template_details ) # documents ( document_id , template_id , document_name , document_description , other_details ) # paragraphs ( paragraph_id , document_id , paragraph_text , other_details ) # templates.template_type_code = ref_template_types.template_type_code # documents.template_id = templates.template_id # paragraphs.document_id = documents.document_id
select count ( * ) from documents
cre_Doc_Template_Mgt
Count the number of documents.
# ref_template_types ( template_type_code , template_type_description ) # templates ( template_id , version_number , template_type_code , date_effective_from , date_effective_to , template_details ) # documents ( document_id , template_id , document_name , document_description , other_details ) # paragraphs ( paragraph_id , document_id , paragraph_text , other_details ) # templates.template_type_code = ref_template_types.template_type_code # documents.template_id = templates.template_id # paragraphs.document_id = documents.document_id
select count ( * ) from documents
cre_Doc_Template_Mgt
List document IDs, document names, and document descriptions for all documents.
# ref_template_types ( template_type_code , template_type_description ) # templates ( template_id , version_number , template_type_code , date_effective_from , date_effective_to , template_details ) # documents ( document_id , template_id , document_name , document_description , other_details ) # paragraphs ( paragraph_id , document_id , paragraph_text , other_details ) # templates.template_type_code = ref_template_types.template_type_code # documents.template_id = templates.template_id # paragraphs.document_id = documents.document_id
select document_id , document_name , document_description from documents