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 company names.
assistant
SELECT name FROM operate_company;
human
What are the types of these companies?
assistant
SELECT name , type FROM operate_company;
human
How many companies have type 'Joint Venture'?
assistant
SELECT COUNT( * ) FROM operate_company GROUP BY type HAVING type = 'Joint Venture';
human
Tell me the most common company type.
assistant
SELECT TYPE , COUNT( * ) FROM operate_company GROUP BY TYPE ORDER BY COUNT( * ) DESC LIMIT 1 ;