problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: How many Wikipedia pages on Catalan are there with the word "nombre" appearing for more than 5 times?. Keep the solution inside sql tag ```sql [SQL-Query] ```
language_corpus
SELECT COUNT(T2.pid) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'nombre' AND T2.occurrences > 5
Write SQL query to solve given problem: How many biwords pairs are there whose second word is "grec"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
language_corpus
SELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T1.word = 'grec'
Write SQL query to solve given problem: What is the title of the page on which the word "grec" has an occurrence of 52 times.. Keep the solution inside sql tag ```sql [SQL-Query] ```
language_corpus
SELECT T3.title FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' AND T2.occurrences = 52
Write SQL query to solve given problem: Among the biwords pairs with "àbac" as its first word, how many of them have an occurrence of over 10?. Keep the solution inside sql tag ```sql [SQL-Query] ```
language_corpus
SELECT COUNT(T2.w2nd) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T1.word = 'àbac' AND T2.occurrences > 10
Write SQL query to solve given problem: What is the average occurrence of the word "grec" on each Wikipedia page that has this word?. Keep the solution inside sql tag ```sql [SQL-Query] ```
language_corpus
SELECT CAST(SUM(T2.occurrences) AS REAL) / COUNT(T1.wid) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'grec'
Write SQL query to solve given problem: How many flights were there on 2018/8/1?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1'
Write SQL query to solve given problem: Among the flights on 2018/8/1, how many of them departed from an airport in New York?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'JFK'
Write SQL query to solve given problem: Please list the destination cities of all the flights that were cancelled on 2018/8/1.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT DEST FROM Airlines WHERE FL_DATE = '2018/8/1' AND CANCELLED = 1 GROUP BY DEST
Write SQL query to solve given problem: Please list the departure airports of the flights on 2018/8/1 that were delayed.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T2.DEP_DELAY > 0 GROUP BY T1.Description
Write SQL query to solve given problem: Among the flights on 2018/8/1, how many of them were scheduled to depart from John F. Kennedy International in New York?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T1.Description = 'New York, NY: John F. Kennedy International'
Write SQL query to solve given problem: For the flight on 2018/8/1 that was delayed for the longest time, which was the destination airport of this flight?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/1' ORDER BY T2.DEP_DELAY DESC LIMIT 1
Write SQL query to solve given problem: Among the flights departing from John F. Kennedy International, how many of them arrived earlier than scheduled?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT SUM(CASE WHEN T2.ARR_DELAY < 0 THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'New York, NY: John F. Kennedy International'
Write SQL query to solve given problem: Among all the flights scheduled to depart from John F. Kennedy International on 2018/8/1, when was the earliest one scheduled to depart?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.DEP_TIME FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T1.Description = 'New York, NY: John F. Kennedy International' AND T2.DEP_TIME IS NOT NULL ORDER BY T2.DEP_TIME ASC LIMIT 1
Write SQL query to solve given problem: How many flights on 2018/8/1 were operated by American Airlines Inc.?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA'
Write SQL query to solve given problem: Please list the flight numbers of all the flights operated by American Airlines Inc. that were scheduled to depart from John F. Kennedy International.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.OP_CARRIER_FL_NUM FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' AND T1.Description = 'New York, NY: John F. Kennedy International' AND T2.FL_DATE = '2018/8/1'
Write SQL query to solve given problem: How many flights operated by American Airlines Inc. on 2018/8/1 were faster than scheduled?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT SUM(CASE WHEN T2.ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA'
Write SQL query to solve given problem: What is the flight number of the flight operated by American Airlines Inc. that had the longest delay in departure?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.OP_CARRIER_FL_NUM FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T1.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' ORDER BY T1.DEP_TIME DESC LIMIT 1
Write SQL query to solve given problem: Among the flights operated by American Airlines Inc., how many of them were scheduled to land in New York?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT SUM(CASE WHEN T2.DEST = 'JFK' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA'
Write SQL query to solve given problem: Among the flights operated by American Airlines Inc. on 2018/8/1, how many of them were cancelled?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT SUM(CASE WHEN T2.CANCELLED = 1 THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA'
Write SQL query to solve given problem: Which airline operated more flights on 2018/8/1, American Airlines Inc. or Endeavor Air Inc.?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT CASE WHEN COUNT(CASE WHEN T3.Description = 'American Airlines Inc.: AA' THEN 1 ELSE NULL END) > COUNT(CASE WHEN T3.Description = 'Endeavor Air Inc.: 9E' THEN 1 ELSE NULL END) THEN 'American Airlines Inc.: AA' ELSE 'Endeavor Air Inc.: 9E' END AS RESULT FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1'
Write SQL query to solve given problem: How many flights on average does American Airlines Inc. operate every day in August, 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT CAST( SUM(CASE WHEN T2.FL_DATE LIKE '2018/8%' THEN 1 ELSE 0 END) AS REAL) / 31 FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA'
Write SQL query to solve given problem: Give the number of planes that took off from Los Angeles International airport on 2018/8/27.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT SUM(CASE WHEN T2.FL_DATE = '2018/8/27' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'Los Angeles, CA: Los Angeles International'
Write SQL query to solve given problem: Provide the number of airplanes that landed on Oakland Airport on 2018/8/7.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT SUM(CASE WHEN T1.Description LIKE '%Oakland%' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/7'
Write SQL query to solve given problem: How many flights of Alaska Airlines were delayed on 2018/8/2?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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
Write SQL query to solve given problem: Tell the number of fights landed earlier on Miami Airport on 2018/8/12.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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
Write SQL query to solve given problem: How many flights from American Airlines were cancelled due to a type A cancellation code?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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
Write SQL query to solve given problem: How many flights of Endeavor Air Inc. were faster than scheduled on 2018/8/31?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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'
Write SQL query to solve given problem: How many planes of Spirit Air Lines took off on 2018/8/7?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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'
Write SQL query to solve given problem: Provide the name of the airport which landed the most number of flights on 2018/8/15.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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
Write SQL query to solve given problem: Tell the number of flights that landed at Lake Charles Regional Airport on 2018/8/15.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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'
Write SQL query to solve given problem: How many flights were there from San Diego International airport to Los Angeles International airport in the August of 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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' )
Write SQL query to solve given problem: What is the percentage of flights from Los Angeles International airport that were cancelled due to a type C cancellation code?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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'
Write SQL query to solve given problem: What is the percentage of flights which landed at Pittsburgh were faster than scheduled?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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
Write SQL query to solve given problem: What is the description of the airline code 19049?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT Description FROM `Air Carriers` WHERE Code = 19049
Write SQL query to solve given problem: How many flights departed on time on 8/1/2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND DEP_DELAY <= 0
Write SQL query to solve given problem: How long was the longest minute delay caused by a weather problem in airport id 12264?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT WEATHER_DELAY FROM Airlines WHERE ORIGIN_AIRPORT_ID = 12264 ORDER BY WEATHER_DELAY DESC LIMIT 1
Write SQL query to solve given problem: What is the origin airport id that recorded the longest delay due to a late aircraft?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT ORIGIN_AIRPORT_ID FROM Airlines ORDER BY LATE_AIRCRAFT_DELAY DESC LIMIT 1
Write SQL query to solve given problem: On August 2018, which day had the highest number of cancelled flights due to the most serious reasons in Dallas/Fort Worth International?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
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
Write SQL query to solve given problem: List the tail numbers of all the aircraft that arrived on time at Meadows Field airport in August of 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.TAIL_NUM FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Bakersfield, CA: Meadows Field' AND T2.DEST = 'BFL' AND T2.ARR_DELAY <= 0 GROUP BY T2.TAIL_NUM
Write SQL query to solve given problem: Among the airports whose destination is Logan International, what is the airline id of the carrier operator with the highest delay in minutes due to security?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.OP_CARRIER_AIRLINE_ID FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T1.Description = 'Boston, MA: Logan International' AND T2.DEST = 'BOS' ORDER BY T2.SECURITY_DELAY DESC LIMIT 1
Write SQL query to solve given problem: What are the names of the top 5 airlines with the highest number of aircraft?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code GROUP BY T2.Description ORDER BY T1.TAIL_NUM DESC LIMIT 5
Write SQL query to solve given problem: What is the name of the airline with the highest number of non-cancelled flights?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLED = 0 GROUP BY T2.Description ORDER BY COUNT(T1.CANCELLED) DESC LIMIT 1
Write SQL query to solve given problem: What is the name of the airline that flew the most flights to Chicago Midway International?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T3.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T1.Description = 'Chicago, IL: Chicago Midway International' AND T2.DEST = 'MDW' GROUP BY T3.Description ORDER BY COUNT(T3.Description) DESC LIMIT 1
Write SQL query to solve given problem: What is the tail number of a Compass Airline's plane that flew the most number of flights from LAX to ABQ?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.OP_CARRIER_AIRLINE_ID FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Compass Airlines: CP' AND T2.ORIGIN = 'LAX' AND T2.DEST = 'ABQ' GROUP BY T2.OP_CARRIER_AIRLINE_ID ORDER BY COUNT(T2.OP_CARRIER_AIRLINE_ID) DESC LIMIT 1
Write SQL query to solve given problem: Which airport did Republic Airline fly the most from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.DEST FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Republic Airline: YX' GROUP BY T2.DEST ORDER BY COUNT(T2.DEST) DESC LIMIT 1
Write SQL query to solve given problem: Which airline does the aircraft with the fastest flight belong to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.OP_CARRIER_AIRLINE_ID FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T1.ORIGIN = T2.Code WHERE T1.ACTUAL_ELAPSED_TIME IS NOT NULL AND T1.CRS_ELAPSED_TIME IS NOT NULL ORDER BY T1.ACTUAL_ELAPSED_TIME - T1.CRS_ELAPSED_TIME ASC LIMIT 1
Write SQL query to solve given problem: How many hours in total did all of the Delta Air Lines aircraft were delayed due to a late aircraft in August of 2018? Identify the plane number of the aircraft with the highest delayed hours.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.TAIL_NUM, SUM(CAST(T1.LATE_AIRCRAFT_DELAY AS REAL) / 60) AS delay FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T2.Code = T1.OP_CARRIER_AIRLINE_ID WHERE T1.FL_DATE LIKE '2018/8/%' AND T2.Description = 'Delta Air Lines Inc.: DL' ORDER BY delay DESC LIMIT 1
Write SQL query to solve given problem: Please list any three airports with their codes.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT Code, Description FROM Airports LIMIT 3
Write SQL query to solve given problem: What is the scheduled local departure time and the actual departure time of the flight from Philadelphia to Harrisburg with the plane's tail number N627AE on the 13th of August 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT CRS_DEP_TIME, DEP_TIME FROM Airlines WHERE ORIGIN = 'PHL' AND DEST = 'MDT' AND TAIL_NUM = 'N627AE' AND FL_DATE = '2018/8/13'
Write SQL query to solve given problem: How many flights on the 1st of August 2018 were coming from Allentown, Pennsylvania?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'ABE'
Write SQL query to solve given problem: How many flights from Dallas to Santa Ana departed on time?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM Airlines WHERE DEST = 'SNA' AND ORIGIN = 'DFW' AND DEP_DELAY = 0
Write SQL query to solve given problem: Which flight carrier operator has the most cancelled flights?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID ORDER BY T2.CANCELLED DESC LIMIT 1
Write SQL query to solve given problem: What is the actual departure time of JetBlue Airways with the plane's tail number N903JB to Fort Lauderdale-Hollywood International Airport on the 20th of August 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.DEP_TIME FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code INNER JOIN Airports AS T3 ON T1.DEST = T3.Code WHERE T1.FL_DATE = '2018/8/20' AND T1.TAIL_NUM = 'N903JB' AND T2.Description LIKE '%JetBlue Airways%' AND T3.Description LIKE '%Fort Lauderdale-Hollywood%'
Write SQL query to solve given problem: What is the total number of flights that have Oklahoma as their origin?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) AS num FROM Airlines WHERE Origin = 'OKC'
Write SQL query to solve given problem: Provide the destinations of flight number 1596.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT DEST FROM Airlines WHERE OP_CARRIER_FL_NUM = 1596
Write SQL query to solve given problem: List the description of the airports that have code that ends with number 3?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT Description FROM Airports WHERE Code LIKE '%3'
Write SQL query to solve given problem: How many cancelled flights are there?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM Airlines WHERE CANCELLED = 1
Write SQL query to solve given problem: List the tail number of flights that flew on August 17, 2018.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT TAIL_NUM FROM Airlines WHERE FL_DATE = '2018/8/17' GROUP BY TAIL_NUM
Write SQL query to solve given problem: Provide the origin of the flight that has the shortest actual elapsed time.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT ORIGIN FROM Airlines ORDER BY ACTUAL_ELAPSED_TIME ASC LIMIT 1
Write SQL query to solve given problem: List the air carrier description and code of the flight with the shortest arrival time.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description, T1.Code FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID ORDER BY T2.ARR_TIME ASC LIMIT 1
Write SQL query to solve given problem: How many flights of air carrier called JetBlue Airways: B6 have 0 new arrival delay?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%JetBlue Airways: B6%' AND T2.ARR_DELAY_NEW = 0
Write SQL query to solve given problem: What is the air carrier's description of the cancelled flights?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.CANCELLED = 1 GROUP BY T1.Description
Write SQL query to solve given problem: Among the flights with air carrier described as Asap Air Inc.: ASP, what is the tail number of the flight with the longest departure delay?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.TAIL_NUM FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Asap Air Inc.: ASP' ORDER BY T2.DEP_DELAY DESC LIMIT 1
Write SQL query to solve given problem: List the air carrier's description of the flights with 0 departure delay.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEP_DELAY = 0 GROUP BY T1.Description
Write SQL query to solve given problem: Provide the air carrier description of the flight with the highest actual elapsed time.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID ORDER BY T2.ACTUAL_ELAPSED_TIME DESC LIMIT 1
Write SQL query to solve given problem: From August 10 to August 20, 2018, how many cancelled flights of air carrier named Spirit Air Lines: NK are there?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Spirit Air Lines: NK' AND T2.CANCELLED = 0 AND T2.FL_DATE BETWEEN '2018/8/10' AND '2018/8/20'
Write SQL query to solve given problem: What is the total number of flights that flew on August 2, 2018 with air carrier described as Horizon Air?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%Horizon Air%' AND T2.FL_DATE = '2018/8/2'
Write SQL query to solve given problem: What is the tail number of the flight with air carrier named Iscargo Hf: ICQ and arrival time of 1000 and below?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.TAIL_NUM FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.ARR_TIME <= 1000 AND T1.Description = 'Iscargo Hf: ICQ'
Write SQL query to solve given problem: List the flight date of flights with air carrier described as Profit Airlines Inc.: XBH which have an actual elapsed time below 100.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.FL_DATE FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.ACTUAL_ELAPSED_TIME < 100 AND T1.Description = 'Profit Airlines Inc.: XBH'
Write SQL query to solve given problem: Among the flights with air carrier named Republic Airline, how many of the flights have departure delay of 30 minutes and above?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%Republic Airline%' AND T2.DEP_DELAY > 30
Write SQL query to solve given problem: What are the air carriers of the flights that flew on August 25, 2018 that have departure delay of -5?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.FL_DATE = '2018/8/25' GROUP BY T1.Description
Write SQL query to solve given problem: Give the air carrier description of the flights that have an earlier arrival and departure.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.ARR_DELAY < 0 AND T2.DEP_DELAY < 0 GROUP BY T1.Description
Write SQL query to solve given problem: Among the flights with air carrier "Southwest Airlines Co.: WN", provide the tail number of flights with an actual elapsed time lower than the 80% of the average actual elapsed time of listed flights.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T2.TAIL_NUM FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Southwest Airlines Co.: WN' AND T2.ACTUAL_ELAPSED_TIME < ( SELECT AVG(ACTUAL_ELAPSED_TIME) * 0.8 FROM Airlines )
Write SQL query to solve given problem: List the air carrier's description with arrival time lower than the 40% of the average arrival time of flights that flew to Phoenix.. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEST = 'PHX' AND T2.ARR_TIME < ( SELECT AVG(ARR_TIME) * 0.4 FROM Airlines ) GROUP BY T1.Description
Write SQL query to solve given problem: Among the flights of the air carrier described as American Airlines, what is the percentage of the flights with earlier departure?. Keep the solution inside sql tag ```sql [SQL-Query] ```
airline
SELECT CAST(SUM(CASE WHEN T2.DEP_DELAY < 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%American Airlines%'
Write SQL query to solve given problem: Among the books published by publisher ID 1929, how many of them have over 500 pages?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT COUNT(*) FROM book WHERE publisher_id = 1929 AND num_pages > 500
Write SQL query to solve given problem: What is the publication date of the book with the most pages?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT publication_date FROM book ORDER BY num_pages DESC LIMIT 1
Write SQL query to solve given problem: What is the name of the publisher of the book "The Illuminati"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Illuminati'
Write SQL query to solve given problem: How many books were published by publisher "Thomas Nelson"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson'
Write SQL query to solve given problem: What is the name of the publisher that has published the most number of books?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T1.book_id) DESC LIMIT 1
Write SQL query to solve given problem: Please give the title of the oldest book published by publisher "Thomas Nelson".. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' ORDER BY T1.publication_date ASC LIMIT 1
Write SQL query to solve given problem: Among the books published by publisher "Thomas Nelson", how many of them have over 300 pages?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' AND T1.num_pages > 300
Write SQL query to solve given problem: What is the name of the publisher of the book with the most pages?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id ORDER BY T1.num_pages DESC LIMIT 1
Write SQL query to solve given problem: How many books are in English?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT COUNT(*) FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'English'
Write SQL query to solve given problem: Please list the titles of all the books in British English.. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'British English'
Write SQL query to solve given problem: What is the cheapest order price of the book "The Little House"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT MIN(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Little House'
Write SQL query to solve given problem: Please list the titles of all the books that Lucas Wyldbore has ordered.. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore'
Write SQL query to solve given problem: Among the books ordered by Lucas Wyldbore, how many of them are over 300 pages?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore' AND T1.num_pages > 300
Write SQL query to solve given problem: What is the total price of all the books ordered by Lucas Wyldbore?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT SUM(T1.price) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'
Write SQL query to solve given problem: How much money on average does Lucas Wyldbore spend on book orders?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT SUM(T1.price) / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'
Write SQL query to solve given problem: Among the books ordered by Lucas Wyldbore, what is the percentage of those books over $13?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT CAST(SUM(CASE WHEN T1.price > 13 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'
Write SQL query to solve given problem: Which city does the address id 547 belong to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT city FROM address WHERE address_id = 547
Write SQL query to solve given problem: How many orders has Cordy Dumbarton made?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Cordy' AND T1.last_name = 'Dumbarton'
Write SQL query to solve given problem: List the title of the earliest published Japanese book.. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Japanese' ORDER BY T1.publication_date ASC LIMIT 1
Write SQL query to solve given problem: For the publisher which published the most books, show its name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T2.publisher_id) DESC LIMIT 1
Write SQL query to solve given problem: How many books were published by Kensington?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT COUNT(T1.book_id) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Kensington'
Write SQL query to solve given problem: Which language was book id 1405 written in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.book_id = 1405
Write SQL query to solve given problem: Which customer has made the most orders? Show his/her full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ORDER BY COUNT(*) DESC LIMIT 1
Write SQL query to solve given problem: Name the book title of the bestseller.. Keep the solution inside sql tag ```sql [SQL-Query] ```
books
SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id GROUP BY T1.title ORDER BY COUNT(T1.title) DESC LIMIT 1