title: MySQL three table join, find item's rating
body: <p>I'm hoping this is an easy one for you gurus, but my SQL knowledge is failing me.</p>
  
  <p>My sample dataset:</p>
  
  <pre><code>item
  ----
  item_id  item_name  item_added
  1        Apple      &lt;date_time&gt;
  2        Banana     &lt;date_time&gt;
  
  user
  ----
  user_id  user_name
  1        Alice
  2        Bob
  3        Carol
  
  rating
  ------
  rating_id  item_id  user_id  rating_value
  1          1        1        3
  2          1        2        4
  3          1        3        5
  4          2        1        5
  5          2        2        2
  </code></pre>
  
  <p>I want to find out what rating all three users have given to a particular item. The output should include NULL for rating_value if the user hasn't rated the item. For example, if I have item_id 2, I'd like to get this output:</p>
  
  <pre><code>user_name    item_name    rating_value
  Alice        Banana       5
  Bob          Banana       2
  Carol        Banana       NULL
  </code></pre>
  
  <p>I've tried all kinds of joins, but I just can't seem to figure this one out.</p>
  
  <p>Many thanks in advance.</p>