Which company has the most buildings? | Do you want to the name of the company? | Yes and the company ID.
select name,id from companies where id  =   ( SELECT company_id from office_locations group by company_id order by count ( * )  desc limit 1 ) 
most buildings refers to MAX(COUNT(*)); company name and ID refers to selecting name, id from companies;