title: How to select with INNER JOIN, giving related but also unrelated records
body: <p>I have this two tables:</p>
  <p><strong>users</strong></p>
  <pre><code>+----+-------+
  | id | name  |
  +----+-------+
  | 1  | John  |
  +----+-------+
  | 2  | Peter |
  +----+-------+
  | 3  | Lucas |
  +----+-------+
  </code></pre>
  <p><strong>gifts</strong></p>
  <pre><code>+----+--------+----------+----------+
  | id | boy_id | type     | quantity |
  +----+--------+----------+----------+
  | 1  | 1      | clothing | 3        |
  +----+--------+----------+----------+
  | 2  | 2      | toy      | 1        |
  +----+--------+----------+----------+
  | 3  | 2      | clothing | 2        |
  +----+--------+----------+----------+
  </code></pre>
  <p>And Im trying to query &quot;gifts received by the boys&quot;, something like this:</p>
  <pre><code>+-------+----------+----------+
  | name  | type     | quantity |
  +-------+----------+----------+
  | John  | clothing | 3        |
  +-------+----------+----------+
  | Peter | toy      | 1        |
  +-------+----------+----------+
  | Peter | clothing | 2        |
  +-------+----------+----------+
  | Lucas | &quot;&quot;       | 0        |
  +-------+----------+----------+
  </code></pre>
  <p>But I just know how to get relationed data with a query like this:</p>
  <pre><code>SELECT u.name, g.type, g.quantity FROM gifts g INNER JOIN users u ON g.boy_id = u.id
  </code></pre>
  <p>So, as Lucas is not in <em>gifts</em> table, Im getting the following:</p>
  <pre><code>+-------+----------+----------+
  | name  | type     | quantity |
  +-------+----------+----------+
  | John  | clothing | 3        |
  +-------+----------+----------+
  | Peter | toy      | 1        |
  +-------+----------+----------+
  | Peter | clothing | 2        |
  +-------+----------+----------+
  </code></pre>
  <p>So, how do I include peter to the result, filling type and quantity with a &quot;&quot; and zero if the boy haven't received a gift?</p>