title: MySQL replace foreign key in result table with data from FK table
body: <p>I have a table like this:</p>
  
  <pre><code>id (PK)   name    teacher (FK)    student (FK)
     1      Ron         3               6
  </code></pre>
  
  <p>Both teacher and student are in another table called <code>people</code>.</p>
  
  <pre><code> people
   id (PK)   name   age
      3      Ali    42
      6      Jon    12
  </code></pre>
  
  <p>I would like to perform a query to obtain the following</p>
  
  <pre><code>name    teacher's name   student's name
   Ron         Ali              Jon
  </code></pre>
  
  <p>Is this possible? I know I can perform two separate joins, but then I am left with two rows and there is no indication of which name is the teacher and which is the student</p>