human
Schema:
pilot (Pilot_Id, Name, Age)
aircraft (Aircraft_ID, Aircraft, Description, Max_Gross_Weight, Total_disk_area, Max_disk_Loading)
match (Round, Location, Country, Date, Fastest_Qualifying, Winning_Pilot, Winning_Aircraft)
airport (Airport_ID, Airport_Name, Total_Passengers, %_Change_2007, International_Passengers, Domestic_Passengers, Transit_Passengers, Aircraft_Movements, Freight_Metric_Tonnes)
airport_aircraft (ID, Airport_ID, Aircraft_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
The column 'winning_pilot ' in Table: 'MATCH' refers to column 'pilot_id' in Table: ' pilot' | Did you mean that you want to get Pilot Id? | Yes
assistant
SELECT distinct t1.pilot_id FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot;
human
find the name and age of the pilot who has won the most number of times among the pilot who are younger than 30
assistant
SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT( * ) DESC LIMIT 1 ;