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.
hours in total = DIVIDE(SUM(LATE_AIRCRAFT_DELAY), 60); Delta Air Lines refers to Description = 'Delta Air Lines Inc.: DL'; delayed due to a late aircraft refers to LATE_AIRCRAFT_DELAY; in August of 2018 refers to FL_DATE like '2018/8/%'; plane number refers to TAIL_NUM; highest delayed hours refers to MAX(DIVIDE(SUM(LATE_AIRCRAFT_DELAY),60));
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
database name:db_id airline
Air Carriers table Air Carriers Cols: Code dtype integer, Description dtype text, 
Airports table Airports Cols: Code dtype text, Description dtype text, 
Airlines table Airlines Cols: flight date dtype text, operator carrier airline id dtype integer, tail number dtype text, operator carrier flight number dtype integer, origin airport id dtype integer, origin airport sequence id dtype integer, origin city market id dtype integer, ORIGIN dtype text, destination airport id dtype integer, destination airport sequence id dtype integer, destination city market id dtype integer, destination dtype text, scheduled local departure time dtype integer, departure time dtype integer, Departure delay dtype integer, departure delay new dtype integer, arrival time dtype integer, arrival delay dtype integer, arrival delay new dtype integer, CANCELLED dtype integer, cancellation code dtype text, scheduled elapsed time dtype integer, actual elapsed time dtype integer, carrier delay dtype integer, weather delay dtype integer, National Aviavtion System delay dtype integer, security delay dtype integer, late aircraft delay dtype integer, 
