title: Join 3 tables in SQLite database
body: <p>I have 3 tables in SQLite database:</p>
  
  <p><strong>Songs:</strong></p>
  
  <pre><code>_id | name | length | artist_id (foreign key) | album_id (foreign key)
  </code></pre>
  
  <p><strong>Artists:</strong></p>
  
  <pre><code>_id | name
  </code></pre>
  
  <p><strong>Albums:</strong></p>
  
  <pre><code>_id | name
  </code></pre>
  
  <p>I need a query (use it in an Android app) of a table that consists of the following columns:</p>
  
  <pre><code>_id | name | length | artist_id | artist_name | album_id | album_name
  </code></pre>
  
  <p>However, I write the following query statement:</p>
  
  <pre><code>SELECT Songs._id, Songs.name, Songs.length, Songs.artist_id, Artists.name, Songs.album_id, Albums.name FROM Songs, Artists, Albums WHERE Songs.artist_id = Artists._id AND Songs.album_id = Albums._id
  </code></pre>
  
  <p>but it gives me an empty table. I tried <code>OR</code> instead of <code>AND</code> and it gives incorrect results (every song duplicates in each album, though the artist is correct). How can I fix my query statement to join the 3 tables in a single table?</p>