In Oracle, you are likely to use:
MERGE INTO b USING (SELECT name, color FROM a) src ON (src.name = b.name AND color = src.color) WHEN NOT MATCHED THEN INSERT (name, color) VALUES (src.name, src.color);
If your table has a primary key (do you really have tables without one?), For example NAME, and you would like to INSERT or UPDATE depending on the presence of an entry in table B, you should use:
MERGE INTO b USING (SELECT name, color FROM a) src ON (src.name = b.name) WHEN NOT MATCHED THEN INSERT (name, color) VALUES (src.name, src.color) WHEN MATCHED THEN UPDATE SET color = src.color;
I believe that SQL Server also has a MERGE statement or similar.
Melle source share