human
Schema:
airport (id, City, Country, IATA, ICAO, name)
operate_company (id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding)
flight (id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_id)
Please answer with SQL.
assistant
Sure, I understand.
human
Show me the names of all the pilots.
assistant
SELECT DISTINCT pilot FROM flight;
human
Which of these pilots piloted a flight in the United States?
assistant
SELECT DISTINCT t2.pilot FROM airport AS t1 JOIN flight AS t2 ON t1.id = t2.airport_id WHERE t1.Country = 'United States';
human
What about the pilots who did it at 'Billund Airport'?
assistant
SELECT DISTINCT t2.pilot FROM airport AS t1 JOIN flight AS t2 ON t1.id = t2.airport_id WHERE t1.name = 'Billund Airport';
human
Which pilots did either one of those?
assistant
SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = "United States" OR T1.name = "Billund Airport" ;