title: Query to retrieve all students in the same classes as one student
body: <p>I'm pretty new/bad at SQL and I am having trouble creating a query to solve the problem below. I was wondering what approach I should do to create an appropriate query. </p>
  
  <p>Jack is in classes Chem, Gym, and Math. Find all the students in the same classes as Jack. ID of Class is referred to Student.</p>
  
  <p>Sample data</p>
  
  <pre><code>Student
  StudentID   Name
  1           Jack
  2           Brad
  3           Tom
  4           Vince
  5           Tim
  
  Class
  StudentID(FK)   class
  1               Chem
  2               Chem
  3               Chem
  4               Gym
  2               Gym
  1               Math
  2               Cooking
  3               Cooking
  </code></pre>
  
  <p>I got as far as</p>
  
  <p><code>SELECT name FROM Student JOIN Class ON (.....)</code></p>
  
  <p>Problems like these are a bit daunting to me. I feel as though I should start small and expand to create the following query but this is quite difficult for me. If anyone could recommend resources to help create queries I would be more than happy to look at them. Thanks!</p>