title: SQL Creating an Alias Column For a Nested Select?
body: <p>Say I have a <code>Person</code> table and a <code>Courses</code> table. In the <code>Person</code> table I have the column <code>PersonName</code>. In the <code>Courses</code> table, let's say I have <code>CourseTitle</code>,<code>PersonName</code> and <code>CourseDifficulty</code>. <code>CourseDifficulty</code> is 1-4 (4 being the hardest). How do I return a list of people from <code>Person</code> and for each person have a column that shows the most difficult class they're taking by <code>CourseTitle</code>.</p>
  
  <p>As far as I know, I'd get the CourseTitle of the most difficult class Brett is taking by doing the following:</p>
  
  <pre><code>SELECT CourseTitle 
  FROM Courses 
  WHERE PersonName = 'Brett' 
    AND CourseDifficulty = (SELECT MAX(CourseDifficulty) 
                            FROM Courses 
                            WHERE PersonName='Brett')
  </code></pre>
  
  <p>But how do I run that for each person in the Person table? I want the results to be something like</p>
  
  <pre class="lang-none prettyprint-override"><code>Brett-SQL For Dummies 4
  Tim-Quantum Mechanics
  Jane-Thermodynamics 2
  </code></pre>
  
  <p>Sorry for the noobness. Thanks in advance for the help!</p>