There is a table 'target' that looks like this:
id val
1 A
2 A
3  
5 A
8 A
9  
There is also a 'source' table that looks like this
id val
1
2  B  
4 B
8 B
9 B   
The directioins ask to use the 'source' table to transform the 'target' table into the 'result' table, which looks like this:
result
id val
1
2 B
3  
5 A
8 B
9 B    
I understand the logic of what the question is asking, as I believe what I need to do is basically say
IF target.id = source.id  
SET target.val = source.val  
ELSE target.val = target.val  
However, I am not completely sure how to accomplish this kind of update in SQL based on conditions w/ multiple tables using postgresql.
 
     
    