1sf/bird-sql-train-with-schema huggingface dataset:
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many flights of Alaska Airlines were delayed on 2018/8/2?
Evidence: Alaska Airlines refers to Description = 'Alaska Airlines Inc.: AS'; delayed refers to DEP_DELAY > 0; on 2018/8/2 refers to FL_DATE = '2018/8/2';
SQL: SELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/2' AND T2.Description = 'Alaska Airlines Inc.: AS' AND T1.DEP_DELAY > 0
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: Tell the number of fights landed earlier on Miami Airport on 2018/8/12.
Evidence: landed on refers to DEST; landed earlier refers to ARR_DELAY < 0; Miami Airport refers to DEST = 'MIA'; on 2018/8/12 refers to FL_DATE = '2018/8/12';
SQL: SELECT COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/12' AND T2.DEST = 'MIA' AND T2.ARR_DELAY < 0
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many flights from American Airlines were cancelled due to a type A cancellation code?
Evidence: American Airlines refers to Description = 'American Airlines Inc.: AA'; cancelled refers to Cancelled = 1; cancelled due to type A cancellation code refers to CANCELLATION_CODE = 'A';
SQL: SELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLATION_CODE = 'A' AND T2.Description = 'American Airlines Inc.: AA' AND T1.CANCELLED = 1
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many flights of Endeavor Air Inc. were faster than scheduled on 2018/8/31?
Evidence: Endeavor Air Inc. refers to Description = 'Endeavor Air Inc.: 9E'; faster than scheduled refers to ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME; on 2018/8/31 refers to FL_DATE = '2018/8/31';
SQL: SELECT SUM(CASE WHEN T1.ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS count FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/31' AND T2.Description = 'Endeavor Air Inc.: 9E'
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many planes of Spirit Air Lines took off on 2018/8/7?
Evidence: Spirit Air Lines refers to Description = 'Spirit Air Lines: NK'; on 2018/8/7 refers to FL_DATE = '2018/8/7';
SQL: SELECT COUNT(T2.Code) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/7' AND T2.Description = 'Spirit Air Lines: NK'
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: For the flight with the tail number 'N702SK', which air carrier does it belong to?
Evidence: tail number refers to TAIL_NUM; TAIL_NUM = 'N702SK';
SQL: SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.TAIL_NUM = 'N702SK' GROUP BY T2.Description
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: Provide the name of the airport which landed the most number of flights on 2018/8/15.
Evidence: name of the airport refers to Description; airport that landed the most number of flights refers to MAX(COUNT(DEST)); on 2018/8/15 refers to FL_DATE = '2018/8/15';
SQL: SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/15' ORDER BY T2.DEST DESC LIMIT 1
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: For the flight from ATL to PHL on 2018/8/1 that scheduled local departure time as "2040", which air carrier does this flight belong to?
Evidence: flight from ATL refers to ORIGIN = 'ATL'; flight to PHL refers to DEST = 'PHL'; on 2018/8/1 refers to FL_DATE = '2018/8/1'; local departure time refers to CRS_DEP_TIME; CRS_DEP_TIME = '2040';
SQL: SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/1' AND T1.ORIGIN = 'ATL' AND T1.DEST = 'PHL' AND T1.CRS_DEP_TIME = '2040' GROUP BY T2.Description
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: Tell the number of flights that landed at Lake Charles Regional Airport on 2018/8/15.
Evidence: landed at refers to DEST; Lake Charles Regional Airport refers to Description = 'Lake Charles, LA: Lake Charles Regional'; on 2018/8/15 refers to FL_DATE = '2018/8/15';
SQL: SELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/15' AND T1.Description = 'Lake Charles, LA: Lake Charles Regional'
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many flights were there from San Diego International airport to Los Angeles International airport in the August of 2018?
Evidence: flights from refers to ORIGIN; San Diego International airport refers to Description = 'San Diego, CA: San Diego International'; flights to refers to DEST; Los Angeles International airport refers to Description = 'Los Angeles, CA: Los Angeles International'; in the August of 2018 refers to FL_DATE like '2018/8%';
SQL: SELECT COUNT(FL_DATE) FROM Airlines WHERE FL_DATE LIKE '2018/8%' AND ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'San Diego, CA: San Diego International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T4.DEST WHERE T3.Description = 'Los Angeles, CA: Los Angeles International' )
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: What is the percentage of flights from Los Angeles International airport that were cancelled due to a type C cancellation code?
Evidence: percentage = MULTIPLY(DIVIDE(SUM(CANCELLATION_CODE = 'C'), COUNT(Code)), 100); flights from refers to ORIGIN; Los Angeles International airport refers to Description = 'Los Angeles, CA: Los Angeles International'; cancelled refers to Cancelled = 1; cancelled due to a type C cancellation code refers to CANCELLATION_CODE = 'C';
SQL: SELECT CAST(SUM(CASE WHEN T2.CANCELLATION_CODE = 'C' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/15' AND T2.CANCELLATION_CODE IS NOT NULL AND T1.Description = 'Los Angeles, CA: Los Angeles International'
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: What is the percentage of flights which landed at Pittsburgh were faster than scheduled?
Evidence: percentage = MULTIPLY(DIVIDE(SUM(ACTUAL_ELAPSED_TIME < T2.CRS_ELAPSED_TIME), COUNT(Code)), 100); landed at refers to DEST; Pittsburgh refers to Description which contains 'Pittsburgh'; faster than scheduled refers to ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME;
SQL: SELECT CAST(SUM(CASE WHEN T1.ACTUAL_ELAPSED_TIME < T1.CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.DEST WHERE T2.Description LIKE '%Pittsburgh%' AND T1.CRS_ELAPSED_TIME IS NOT NULL AND T1.ACTUAL_ELAPSED_TIME IS NOT NULL
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: What is the description of the airline code 19049?
SQL: SELECT Description FROM `Air Carriers` WHERE Code = 19049
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many flights departed on time on 8/1/2018?
Evidence: departed on time refers to DEP_DELAY < = 0; on 8/1/2018 refers to FL_DATE = '2018/8/1';
SQL: SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND DEP_DELAY <= 0
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: What are the codes of the airport found in Ankara, Turkey?
Evidence: airport found in Ankara, Turkey refers to Description like '%Ankara, Turkey%';
SQL: SELECT Code FROM Airports WHERE Description LIKE '%Ankara, Turkey%'
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How long was the longest minute delay caused by a weather problem in airport id 12264?
Evidence: longest minute delay caused by a weather problem refers to MAX(WEATHER_DELAY); airport id refers to ORIGIN_AIRPORT_ID; ORIGIN_AIRPORT_ID = 12264;
SQL: SELECT WEATHER_DELAY FROM Airlines WHERE ORIGIN_AIRPORT_ID = 12264 ORDER BY WEATHER_DELAY DESC LIMIT 1
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: What is the IATA code of the Anita Bay Airport in Anita Bay, Alaska?
Evidence: IATA code refers to Code; Anita Bay Airport in Anita Bay, Alaska refers to Description = 'Anita Bay, AK: Anita Bay Airport';
SQL: SELECT Code FROM Airports WHERE Description = 'Anita Bay, AK: Anita Bay Airport'
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: What is the origin airport id that recorded the longest delay due to a late aircraft?
Evidence: origin airport id refers to ORIGIN_AIRPORT_ID; longest delay due to a late aircraft refers to MAX(LATE_AIRCRAFT_DELAY);
SQL: SELECT ORIGIN_AIRPORT_ID FROM Airlines ORDER BY LATE_AIRCRAFT_DELAY DESC LIMIT 1
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many flights depart to Hartsfield-Jackson Atlanta International from Chicago O'Hare International?
Evidence: depart to refers to DEST; Hartsfield-Jackson Atlanta International refers to Description = 'Atlanta, GA: Hartsfield-Jackson Atlanta International'; depart from refers to ORIGIN; Chicago O'Hare International refes to Description = 'Chicago, IL: Chicago O'Hare International';
SQL: SELECT COUNT(FL_DATE) FROM Airlines WHERE ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'Chicago, IL: Chicago O''Hare International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T4.DEST WHERE T3.Description = 'Atlanta, GA: Hartsfield-Jackson Atlanta International' )
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: How many planes does Southwest Airlines Co. have?
Evidence: planes refers to TAIL_NUM; Southwest Airlines Co. refers to Description = 'Southwest Airlines Co.: WN';
SQL: SELECT COUNT(T3.TAIL_NUM) FROM ( SELECT T1.TAIL_NUM FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T2.Description = 'Southwest Airlines Co.: WN' GROUP BY T1.TAIL_NUM ) T3
Database: airline
Tables: Air Carriers, Airports, Airlines
Columns (table index, column name): -1, *, 0, Code, 0, Description, 1, Code, 1, Description, 2, FL_DATE, 2, OP_CARRIER_AIRLINE_ID, 2, TAIL_NUM, 2, OP_CARRIER_FL_NUM, 2, ORIGIN_AIRPORT_ID, 2, ORIGIN_AIRPORT_SEQ_ID, 2, ORIGIN_CITY_MARKET_ID, 2, ORIGIN, 2, DEST_AIRPORT_ID, 2, DEST_AIRPORT_SEQ_ID, 2, DEST_CITY_MARKET_ID, 2, DEST, 2, CRS_DEP_TIME, 2, DEP_TIME, 2, DEP_DELAY, 2, DEP_DELAY_NEW, 2, ARR_TIME, 2, ARR_DELAY, 2, ARR_DELAY_NEW, 2, CANCELLED, 2, CANCELLATION_CODE, 2, CRS_ELAPSED_TIME, 2, ACTUAL_ELAPSED_TIME, 2, CARRIER_DELAY, 2, WEATHER_DELAY, 2, NAS_DELAY, 2, SECURITY_DELAY, 2, LATE_AIRCRAFT_DELAY
Question: On August 2018, which day had the highest number of cancelled flights due to the most serious reasons in Dallas/Fort Worth International?
Evidence: On August 2018 refers to FL_DATE like '2018/8%'; day with the highest number of cancelled flights refers to MAX(COUNT(FL_DATE WHERE CANCELLED = 1)); cancelled due to the most serious reasons refers to CANCELLATION_CODE = 'A'; in Dallas/Fort Worth International refers to Description = 'Dallas/Fort Worth, TX: Dallas/Fort Worth International';
SQL: SELECT T2.FL_DATE FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Dallas/Fort Worth, TX: Dallas/Fort Worth International' AND T2.ORIGIN = 'DFW' AND T2.CANCELLED = 1 AND T2.CANCELLATION_CODE = 'A' GROUP BY T2.FL_DATE ORDER BY COUNT(T2.FL_DATE) DESC LIMIT 1