title: Storing structured data in a database column?
body: <p>I have been having a debate with a coworker about whether it would be a good idea to store structured data (such as XML or JSON) in a database column instead of creating subtables.  For example, say we need to store information about questions.  The two types of questions are Multiple choice and Rating (rate from 1-10 for example).  I would typically create at structure like the one below:</p>
  
  <pre><code>Table                   |   Columns
  ------------------------------------------------------
  Question                | ID, Title, QuestionTypeId
  Question_MultipleChoice | QuestionId, Choice
  Question_Rating         | QuestionId, Min, Max
  QuestionTypes           | ID, TypeName
  </code></pre>
  
  <p>My co-worker believes it would be better to store information in a single <code>Question</code> table with a column for subinfo.  For example:</p>
  
  <pre><code>Question
  ----------------
  ID
  Title
  SubInfo  &lt;-- JSON
  </code></pre>
  
  <p>Because it would make queries simpler and possibly faster by avoiding JOINS.  Are there reasons that this type of database structure should be avoided?  It seems like if you need to query based on the data in the <code>SubInfo</code> column this would be a bad idea, but if that is not needed, is this a reasonable database structure?</p>