Which third party companies have at least 2 maintenance engineers? List the id and name of that company.
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
Show me names and ids of third party companies that have at least 2 maintenance contracts as well, along with the previous result.
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