List the names of all the companies.
select name from operate_company
How many flights did each of these companies operate?
select t1.name, count(*) from operate_company as t1 join flight as t2 on t1.id = t2.company_id group by t1.id
Show me only the companies that operated more than one flight.
select t1.name, count(*) from operate_company as t1 join flight as t2 on t1.id = t2.company_id group by t1.id having count(*) > 1
Show me only the ids and the names of these companies.
select t1.id, t1.name from operate_company as t1 join flight as t2 on t1.id = t2.company_id group by t1.id having count(*) > 1