title: Joining these two specific tables
body: <p>I have encountered a interesting problem today (or so it seems to me) and I thought it would be productive to share it.</p>
  
  <p>I have two database tables with the following construct:</p>
  
  <p><strong>Table 1: mod_class</strong></p>
  
  <pre><code>class_id
  CSD2311 
  CSD2314
  CSD12
  </code></pre>
  
  <p><strong>Table 2: m_classes_enrolled_in</strong><br/></p>
  
  <pre><code>student_id   class_id
  5            CSD2311
  5            CSD2314
  </code></pre>
  
  <p>So the first table has all possible  class_id's and the second one has class_id's and the student that is enrolled in that class. I would like to create a list of all classes that the student is <strong>not enrolled in</strong>. So far a left-join looked really nice but it seems impossible to display it in this way:</p>
  
  <pre><code>SELECT mod_enrolled_in.class_id 
  FROM mod_enrolled_in 
  WHERE student_id &lt;&gt; 5 
  INNER JOIN mod_class 
  ON mod_enrolled_in.class_id = mod_class.class_id
  </code></pre>
  
  <p>Any help would be greatly appreciated,
  -D</p>