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 all the companies.
assistant
SELECT name FROM operate_company;
human
Which of these companies operate flights?
assistant
SELECT DISTINCT name FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id ;