title: How to Implement Join In Mysql to Fetch the Following Record
body: <p>I am new to mysql I have three tables as follows</p>
  
  <p>Table No 1 purchase</p>
  
  <pre><code> +--------+-----------+--------+
   | UserID | productID |  traID |
   +--------+-----------+--------+
   | 525    |    2      |  602   |
   +--------+-----------+--------+
   | 525    |   1001    |  602   |
   +--------+-----------+--------+
   | 525    |   1002    |  602   |
   +--------+-----------+--------+
   | 525    |    1      |  602   |
   +--------+-----------+--------+
  </code></pre>
  
  <p>Table No 2 Deals</p>
  
  <pre><code> +--------+-----------+
   | dealsid| deals_name|
   +--------+-----------+
   |   1    | First Deal|
   +--------+-----------+
   |   2    |Second Deal|
   +--------+-----------+
  </code></pre>
  
  <p>Table No 3 Productmaster</p>
  
  <pre><code> +-----------+--------------+
   | productID | product_name |
   +-----------+--------------+
   | 1001      | HTML         |
   +-----------+--------------+
   | 1002      | JAVA         |
   +-----------+--------------+
  </code></pre>
  
  <p>I want the output of the above table as follows</p>
  
  <p>(First Deal , Second Deal , HTML, JAVA)</p>
  
  <p>The where Clause can be implemented to purchase.traID = 602 as I have posted on the above table.</p>
  
  <p>Please help me with some mysql query.</p>