title: Organizing & normalising RSS Feed categories data
body: <p>I am having trouble normalising data from a RSS Feed into a database.</p>
  
  <p>Each post would have <code>id</code> and <code>categories</code>.</p>
  
  <p>The problem I am having is that <code>categories</code> is a list which is not predefined in size. By 1NF I should split a list up such that each column only has atomic data:</p>
  
  <pre><code>+----+----------+
  | id |   name   |
  +----+----------+
  |  1 | flying   |
  |  2 | swimming |
  |  3 | throwing |
  |  4 | sleeping |
  |  5 | etc      |
  +----+----------+
  </code></pre>
  
  <p>However, blog posts can have more than one category tagged. This means that the <code>posts</code> table can have a list of ids of the categories tagged.</p>
  
  <p>Alternatively, the <code>categories</code> table can have two ids:</p>
  
  <pre><code>+----+--------+----------+
  | id | postId |   name   |
  +----+--------+----------+
  |  1 |      1 | flying   |
  |  2 |      1 | swimming |
  |  3 |      1 | throwing |
  |  4 |      2 | flying   |
  |  5 |      2 | swimming |
  |  6 |      2 | etc      |
  +----+--------+----------+
  </code></pre>
  
  <p>And the <code>posts</code> table <code>id</code> will reference the <code>postId</code> column. However, there is repeated data, which is not good.</p>
  
  <p>Lastly, another method I had thought of was to put all the categories in one table:</p>
  
  <pre><code>+----+--------+----------+----------+----------+-----+
  | id | flying | swimming | throwing | sleeping | etc |
  +----+--------+----------+----------+----------+-----+
  |  1 |      1 |        1 |        1 |        1 |   1 |
  |  2 |      0 |        1 |        0 |        0 |   0 |
  |  3 |      1 |        1 |        0 |        0 |   1 |
  |  4 |      0 |        0 |        1 |        1 |   1 |
  +----+--------+----------+----------+----------+-----+
  </code></pre>
  
  <p><code>1</code>s representing present and <code>0</code>s representing absent, the <code>id</code> in the <code>posts</code> table references <code>id</code>. This method would not have any repeated data. However, categories from blogs can be created at will, making it hard to maintain such a table as I would need to update it every time there is a new category.</p>
  
  <p>How do I put my database in 3NF, eliminating repetition while keeping it maintainable?</p>