Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.
create table maintenance_contracts (maintenance_contract_company_id varchar, PRIMARY KEY (maintenance_contract_company_id)); create table maintenance_engineers (company_id varchar, PRIMARY KEY (company_id)); create table third_party_companies (company_id varchar, company_name varchar, PRIMARY KEY (company_id))
select t1.company_id, t1.company_name from third_party_companies as t1 join maintenance_engineers as t2 on t1.company_id = t2.company_id group by t1.company_id having count(*) >= 2 union select t3.company_id, t3.company_name from third_party_companies as t3 join maintenance_contracts as t4 on t3.company_id = t4.maintenance_contract_company_id group by t3.company_id having count(*) >= 2