title: Joining tables in sql for many to many relation
body: <pre><code>create table matches (id int, team_a_id int, team_b_id int, winner_id int); &lt;br&gt;
  create table teams (id, name )
  </code></pre>
  
  <p>Here are two tables and I want to join them in a way that <code>team_a_id</code>, <code>team_b_id</code> and <code>winner_id</code> is changed to name of the team and entire table remains same as a first table. I am unable to think how can i achieve it. Please can anyone help me out.</p>
  
  <pre><code>o/p &lt;br&gt;
  id | first_team_name | second_team_name | winner_name |
  </code></pre>