title: Insert record if not present for all keys in master table
body: <p>I have two tables as mentioned below</p>
  
  <p>Table1 contains the key</p>
  
  <pre><code>| key  |  
  | k1   |
  | k2   | 
  | k3   | 
  </code></pre>
  
  <p>Table2 contains the mapping of key with resource</p>
  
  <pre><code>  | res  |   key    |
    | r1   | k1       |
    | r1   | k2       |
    | r2   | k1       |
  </code></pre>
  
  <p>Final goal is to have a mappings in table2 for each resource with each key.
  As table2 is not complete, so i need to insert mappings which are not present.</p>
  
  <p>So How to find out which resource - key mapping is missing in tale2
  and then insert them into table2</p>
  
  <p>as below keys are missing in table2</p>
  
  <pre><code>| res| key  |  
  | r1 | k3   |
  | r2 | k2   | 
  | r2 | k3   | 
  </code></pre>
  
  <p>So finally table2 would look like below.</p>
  
  <pre><code>  | res  |   key    |
    | r1   | k1       |
    | r1   | k2       |
    | r1   | k3       |
    | r2   | k1       |
    | r2   | k2       |
    | r2   | k3       |
  </code></pre>
  
  <p>Any help would be much appreciated.</p>