update Firm
set Number_of_sites = (select count(*)
from Addresses
where FirmID = Firm.FirmID)