How many companies operates airlines in each airport?
create table airport (id varchar, PRIMARY KEY (id)); create table flight (id varchar, PRIMARY KEY (id)); create table operate_company (id varchar, PRIMARY KEY (id))
select t3.id, count(*) from operate_company as t1 join flight as t2 on t1.id = t2.company_id join airport as t3 on t2.airport_id = t3.id group by t3.id