update B set address=a.address from a where a.name=b.nameinsert B (name,address) select name,address from a where name not in (select name from b)