nl
stringlengths
18
174
sql
stringlengths
20
422
db_id
stringclasses
20 values
table_schema
stringclasses
90 values
Return the name of the airport with code 'AKO'.
SELECT AirportName FROM AIRPORTS WHERE AirportCode = "AKO"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}]
What are airport names at City 'Aberdeen'?
SELECT AirportName FROM AIRPORTS WHERE City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}]
What are the names of airports in Aberdeen?
SELECT AirportName FROM AIRPORTS WHERE City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}]
How many flights depart from 'APG'?
SELECT count(*) FROM FLIGHTS WHERE SourceAirport = "APG"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Count the number of flights departing from 'APG'.
SELECT count(*) FROM FLIGHTS WHERE SourceAirport = "APG"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many flights have destination ATO?
SELECT count(*) FROM FLIGHTS WHERE DestAirport = "ATO"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Count the number of flights into ATO.
SELECT count(*) FROM FLIGHTS WHERE DestAirport = "ATO"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many flights depart from City Aberdeen?
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Return the number of flights departing from Aberdeen.
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many flights arriving in Aberdeen city?
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Return the number of flights arriving in Aberdeen.
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many flights depart from City 'Aberdeen' and have destination City 'Ashley'?
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRPORTS AS T3 ON T1.SourceAirport = T3.AirportCode WHERE T2.City = "Ashley" AND T3.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many flights fly from Aberdeen to Ashley?
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRPORTS AS T3 ON T1.SourceAirport = T3.AirportCode WHERE T2.City = "Ashley" AND T3.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many flights does airline 'JetBlue Airways' have?
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = "JetBlue Airways"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Give the number of Jetblue Airways flights.
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = "JetBlue Airways"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many 'United Airlines' flights go to Airport 'ASY'?
SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.DestAirport = "ASY"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Count the number of United Airlines flights arriving in ASY Airport.
SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.DestAirport = "ASY"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many 'United Airlines' flights depart from Airport 'AHD'?
SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.SourceAirport = "AHD"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Return the number of United Airlines flights leaving from AHD Airport.
SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.SourceAirport = "AHD"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many United Airlines flights go to City 'Aberdeen'?
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid = T1.Airline WHERE T2.City = "Aberdeen" AND T3.Airline = "United Airlines"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Count the number of United Airlines flights that arrive in Aberdeen.
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid = T1.Airline WHERE T2.City = "Aberdeen" AND T3.Airline = "United Airlines"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which city has most number of arriving flights?
SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which city has the most frequent destination airport?
SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which city has most number of departing flights?
SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.SourceAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which city is the most frequent source airport?
SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.SourceAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What is the code of airport that has the highest number of flights?
SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What is the airport code of the airport with the most flights?
SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What is the code of airport that has fewest number of flights?
SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Give the code of the airport with the least flights.
SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) LIMIT 1
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airline has most number of flights?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What airline serves the most flights?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY count(*) DESC LIMIT 1
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Find the abbreviation and country of the airline that has fewest number of flights?
SELECT T1.Abbreviation , T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY count(*) LIMIT 1
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What is the abbreviation of the airilne has the fewest flights and what country is it in?
SELECT T1.Abbreviation , T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY count(*) LIMIT 1
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What are airlines that have some flight departing from airport 'AHD'?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "AHD"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airlines have a flight with source airport AHD?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "AHD"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What are airlines that have flights arriving at airport 'AHD'?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = "AHD"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airlines have a flight with destination airport AHD?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = "AHD"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Find all airlines that have flights from both airports 'APG' and 'CVO'.
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG" INTERSECT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airlines have departing flights from both APG and CVO airports?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG" INTERSECT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Find all airlines that have flights from airport 'CVO' but not from 'APG'.
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO" EXCEPT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airlines have departures from CVO but not from APG airports?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO" EXCEPT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Find all airlines that have at least 10 flights.
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airlines have at least 10 flights?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Find all airlines that have fewer than 200 flights.
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) < 200
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airlines have less than 200 flights?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) < 200
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What are flight numbers of Airline "United Airlines"?
SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = "United Airlines"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which flight numbers correspond to United Airlines flights?
SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = "United Airlines"
flight_2
[{'table_name': 'airlines', 'table_schema': [{'col_name': 'airline id'}, {'col_name': 'airline name'}, {'col_name': 'abbreviation'}, {'col_name': 'country'}], 'foreign_key_columns': [], 'primary_keys': ['airline id']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What are flight numbers of flights departing from Airport "APG"?
SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = "APG"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Give the flight numbers of flights leaving from APG.
SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = "APG"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What are flight numbers of flights arriving at Airport "APG"?
SELECT FlightNo FROM FLIGHTS WHERE DestAirport = "APG"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Give the flight numbers of flights landing at APG.
SELECT FlightNo FROM FLIGHTS WHERE DestAirport = "APG"
flight_2
[{'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What are flight numbers of flights departing from City "Aberdeen "?
SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Give the flight numbers of flights leaving from Aberdeen.
SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
What are flight numbers of flights arriving at City "Aberdeen"?
SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Give the flight numbers of flights arriving in Aberdeen.
SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Find the number of flights landing in the city of Aberdeen or Abilene.
SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many flights land in Aberdeen or Abilene?
SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene"
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Find the name of airports which do not have any flight in and out.
SELECT AirportName FROM Airports WHERE AirportCode NOT IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
Which airports do not have departing or arriving flights?
SELECT AirportName FROM Airports WHERE AirportCode NOT IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)
flight_2
[{'table_name': 'airports', 'table_schema': [{'col_name': 'city'}, {'col_name': 'airport code'}, {'col_name': 'airport name'}, {'col_name': 'country'}, {'col_name': 'country abbrev'}], 'foreign_key_columns': [], 'primary_keys': ['airport code']}, {'table_name': 'flights', 'table_schema': [{'col_name': 'airline'}, {'col_name': 'flight number'}, {'col_name': 'source airport'}, {'col_name': 'destination airport'}], 'foreign_key_columns': ['destination airport', 'source airport'], 'primary_keys': ['airline']}]
How many employees are there?
SELECT count(*) FROM employee
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
Count the number of employees
SELECT count(*) FROM employee
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
Sort employee names by their age in ascending order.
SELECT name FROM employee ORDER BY age
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
List the names of employees and sort in ascending order of age.
SELECT name FROM employee ORDER BY age
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
What is the number of employees from each city?
SELECT count(*) , city FROM employee GROUP BY city
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
Count the number of employees for each city.
SELECT count(*) , city FROM employee GROUP BY city
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
Which cities do more than one employee under age 30 come from?
SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
Find the cities that have more than one employee under age 30.
SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}]
Find the number of shops in each location.
SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
How many shops are there in each location?
SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
Find the manager name and district of the shop whose number of products is the largest.
SELECT manager_name , district FROM shop ORDER BY number_products DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
What are the manager name and district of the shop that sells the largest number of products?
SELECT manager_name , district FROM shop ORDER BY number_products DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
find the minimum and maximum number of products of all stores.
SELECT min(Number_products) , max(Number_products) FROM shop
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
What are the minimum and maximum number of products across all the shops?
SELECT min(Number_products) , max(Number_products) FROM shop
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
Return the name, location and district of all shops in descending order of number of products.
SELECT name , LOCATION , district FROM shop ORDER BY number_products DESC
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
Sort all the shops by number products in descending order, and return the name, location and district of each shop.
SELECT name , LOCATION , district FROM shop ORDER BY number_products DESC
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
Find the names of stores whose number products is more than the average number of products.
SELECT name FROM shop WHERE number_products > (SELECT avg(number_products) FROM shop)
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
Which shops' number products is above the average? Give me the shop names.
SELECT name FROM shop WHERE number_products > (SELECT avg(number_products) FROM shop)
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
find the name of employee who was awarded the most times in the evaluation.
SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}, {'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
Which employee received the most awards in evaluations? Give me the employee name.
SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}, {'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
Find the name of the employee who got the highest one time bonus.
SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID ORDER BY t2.bonus DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}, {'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
Which employee received the biggest bonus? Give me the employee name.
SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID ORDER BY t2.bonus DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}, {'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
Find the names of employees who never won any award in the evaluation.
SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}, {'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
What are the names of the employees who never received any evaluation?
SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)
employee_hire_evaluation
[{'table_name': 'employee', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'city'}], 'foreign_key_columns': [], 'primary_keys': ['employee id']}, {'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
What is the name of the shop that is hiring the largest number of employees?
SELECT t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t1.shop_id ORDER BY count(*) DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}, {'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
Which shop has the most employees? Give me the shop name.
SELECT t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t1.shop_id ORDER BY count(*) DESC LIMIT 1
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}, {'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
Find the name of the shops that do not hire any employee.
SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring)
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}, {'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
Which shops run with no employees? Find the shop names
SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring)
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}, {'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
Find the number of employees hired in each shop; show the shop name as well.
SELECT count(*) , t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}, {'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
For each shop, return the number of employees working there and the name of the shop.
SELECT count(*) , t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}, {'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
What is total bonus given in all evaluations?
SELECT sum(bonus) FROM evaluation
employee_hire_evaluation
[{'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
Find the total amount of bonus given in all the evaluations.
SELECT sum(bonus) FROM evaluation
employee_hire_evaluation
[{'table_name': 'evaluation', 'table_schema': [{'col_name': 'employee id'}, {'col_name': 'year awarded'}, {'col_name': 'bonus'}], 'foreign_key_columns': ['employee id'], 'primary_keys': ['employee id']}]
Give me all the information about hiring.
SELECT * FROM hiring
employee_hire_evaluation
[{'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
What is all the information about hiring?
SELECT * FROM hiring
employee_hire_evaluation
[{'table_name': 'hiring', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'employee id'}, {'col_name': 'start from'}, {'col_name': 'is full time'}], 'foreign_key_columns': ['employee id', 'shop id'], 'primary_keys': ['employee id']}]
Which district has both stores with less than 3000 products and stores with more than 10000 products?
SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
Find the districts in which there are both shops selling less than 3000 products and shops selling more than 10000 products.
SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
How many different store locations are there?
SELECT count(DISTINCT LOCATION) FROM shop
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
Count the number of distinct store locations.
SELECT count(DISTINCT LOCATION) FROM shop
employee_hire_evaluation
[{'table_name': 'shop', 'table_schema': [{'col_name': 'shop id'}, {'col_name': 'name'}, {'col_name': 'location'}, {'col_name': 'district'}, {'col_name': 'number products'}, {'col_name': 'manager name'}], 'foreign_key_columns': [], 'primary_keys': ['shop id']}]
How many documents do we have?
SELECT count(*) FROM Documents
cre_Doc_Template_Mgt
[{'table_name': 'documents', 'table_schema': [{'col_name': 'document id'}, {'col_name': 'template id'}, {'col_name': 'document name'}, {'col_name': 'document description'}, {'col_name': 'other details'}], 'foreign_key_columns': ['template id'], 'primary_keys': ['document id']}]
Count the number of documents.
SELECT count(*) FROM Documents
cre_Doc_Template_Mgt
[{'table_name': 'documents', 'table_schema': [{'col_name': 'document id'}, {'col_name': 'template id'}, {'col_name': 'document name'}, {'col_name': 'document description'}, {'col_name': 'other details'}], 'foreign_key_columns': ['template id'], 'primary_keys': ['document id']}]
List document IDs, document names, and document descriptions for all documents.
SELECT document_id , document_name , document_description FROM Documents
cre_Doc_Template_Mgt
[{'table_name': 'documents', 'table_schema': [{'col_name': 'document id'}, {'col_name': 'template id'}, {'col_name': 'document name'}, {'col_name': 'document description'}, {'col_name': 'other details'}], 'foreign_key_columns': ['template id'], 'primary_keys': ['document id']}]