title: null problem when building sql transaction associate table
body: <p>Here is the original table:</p>
  <pre><code>| country  | hostingcity |hostingembasy | statesecretary |
  | -------- | ----------- | ------------ | -------------- |
  | U.K.     | London      | U.S.A        | John           |
  | U.K.     | London      | China        | Li             |
  | U.K.     | London      | Japan        | Akira          |
  | Germany  | Berlin      | U.S.A        | John           |
  | Germany  | Berlin      | Austria      | Jurgen         |
  | N.Korea  | null        | null         | Kim            |
  </code></pre>
  <p>A lot of redundancy and given hostingembasy and statesecretary don't depend on primary key country we can create two tables:</p>
  <p>First table:</p>
  <pre><code>| country  | hostingcity |
  | -------  | ----------- |
  | U.K.     | London      |
  | Germany  | Berlin      |
  | N.Korea  | null        |
  </code></pre>
  <p>Second table:</p>
  <pre><code>| hostingembasy | statesecretary |
  | ------------- | -------------- |
  | U.S.A         | John           |
  | China         | Li             |
  | Japan         | Akira          |
  | Austria       | Jurgen         |
  | null          | Kim            |
  </code></pre>
  <p>And transaction table:</p>
  <pre><code>| country | hostingembasy |
  | ------- | ------------- |
  | U.K.    |  U.S.A        |
  | U.K.    |  China        |
  | U.K.    |  Japan        |
  | Germany |  U.S.A        |
  | Germany |  Austria      |
  | N.Korea |  null         |
  </code></pre>
  <p>Of course, this can not work, because the primary key in the second table can not be null. So how to deal with this kind of problem when we want to try and normalize tables? This is just an example, but I can think of many cases like this. I guess it must be quiet often to see a problem like this.</p>