title: EAV - Add rows with null value if row does not exist
body: <p>I have the following table storing data in the EAV model:</p>
  
  <pre><code>+-------------+---------+------+-----+---------+-------+
  | Field       | Type    | Null | Key | Default | Extra |
  +-------------+---------+------+-----+---------+-------+
  | user_id     | int(11) | NO   | MUL | NULL    |       |
  | question_id | int(11) | NO   | MUL | NULL    |       |
  | answer      | blob    | YES  |     | NULL    |       |
  +-------------+---------+------+-----+---------+-------+
  </code></pre>
  
  <p>With a table to hold the different types of question:</p>
  
  <pre><code>+----------+---------+------+-----+---------+----------------+
  | Field    | Type    | Null | Key | Default | Extra          |
  +----------+---------+------+-----+---------+----------------+
  | id       | int(11) | NO   | PRI | NULL    | auto_increment |
  | question | blob    | YES  |     | NULL    |                |
  +----------+---------+------+-----+---------+----------------+
  </code></pre>
  
  <p>As well as a users table: </p>
  
  <pre><code>+------------------+--------------+------+-----+---------+----------------+
  | Field            | Type         | Null | Key | Default | Extra          |
  +------------------+--------------+------+-----+---------+----------------+
  | id               | int(11)      | NO   | PRI | NULL    | auto_increment |
  | user_name        | varchar(128) | YES  |     | NULL    |                |
  +------------------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>How would I write a query to insert a row with a null value for <code>answer</code> for each <code>question_id</code> that each user does not currently have a row for?</p>
  
  <p>For example, if I have <code>question_id</code>s <code>1,2,3,4</code> and my table storing data looks like:</p>
  
  <pre><code>+--------------+---------------+--------+
  | user_id      | question_id   | answer |
  +--------------+---------+-----+--------+
  | 1            | 1             | example|
  | 1            | 3             | example|
  | 1            | 4             | example|
  +--------------+---------+-----+--------+
  </code></pre>
  
  <p>I want to insert a row that looks like :</p>
  
  <pre><code>+--------------+---------------+--------+
  | user_id      | question_id   | answer |
  +--------------+---------+-----+--------+
  | 1            | 2             | NULL   |
  +--------------+---------+-----+--------+
  </code></pre>
  
  <p>I tried something like this:</p>
  
  <pre><code>INSERT INTO profile_answers
  (
      user_id,
      question_id,
      answer
  )
  
  SELECT
      id,
      profile_answers.question_id,
      null
  FROM users
  LEFT JOIN profile_answers ON profile_answers.user_id = users.id
  WHERE NOT EXISTS (
      SELECT answer 
      FROM profile_answers 
      WHERE user_id = id
      AND question_id IN (
          SELECT GROUP_CONCAT(id SEPARATOR ',') FROM profile_questions
      )
  )
  </code></pre>
  
  <p>But I ended up inserting rows with a <code>question id</code> of 0.</p>