Query join tables
<p>I have the following three tables:</p>

<p><strong>Medaltypes</strong></p>

<pre><code>id          name           description
6           Medalname      Right on!
7           Medalname2     Aswsome
8           Medalname3     Allright
</code></pre>

<p><strong>Medals</strong></p>

<pre><code>id          medaltype      userref   
1           6              MYUSERNAME
2           7              MYUSERNAME
3           6              OTHERUSER
4           6              OTHERUSERALSO
</code></pre>

<p><strong>Userprofiles</strong></p>

<pre><code>userid       userref 
1            MYUSERNAME
2            OTHERUSER
3            OTHERUSERALSO
</code></pre>

<p>What I want is a result of all medaltypes for a specific userid including the onces earned and the onces still to be earned. Like for userid 1 this would be as outcome:</p>

<pre><code>Medalname        - Earned
Medalname2       - Earned
Medalname3       - To be earned
</code></pre>

<p>I can get a list with the Medaltypes and Medals with a left join but as soon as I join in (let alone query on specific userid) Userprofiles it reduces the list.</p>

<p>How should this query look? </p>