title: Select from multiple tables mysql Java
body: <p>How can I insert distinct movie titles to an Arraylist with a given theater city variable?</p>
  
  <p>For example I want the Arraylist to be populated with all of the movie titles that in the showtimes table are linked to a theater id that its city is LA.</p>
  
  <p><strong>showtimes</strong> table</p>
  
  <pre><code>id  movieId theaterId 
  1   1        1
  2   1        1
  3   1        2
  4   1        2
  5   2        2
  6   2        2
  7   1        3
  8   4        1
  </code></pre>
  
  <p><strong>theaters</strong> table</p>
  
  <pre><code>id city
  1  LA
  2  NY
  2  NJ
  </code></pre>
  
  <p><strong>movies</strong> table</p>
  
  <pre><code>id  title 
  1   avengers  
  2   matrix   
  3   lotr
  4   inception
  </code></pre>
  
  <p>Result Arraylist should be populated with : avengers and inception
  because LA id is 1 which in the showtimes table leads to <code>movieId</code> <em>1,1,4</em>
  and these <code>movieId</code> leads to the movies table title avengers and inception (avengers should be inserted only once (distinct))</p>