title: mysql join query should retrive result from 2 or 3 tables
body: <p>I have 3 tables.
  product table name:pc_products</p>
  
  <pre><code>id_product|id_merchant|product_name|product_category
  123         flipkart     glass1          sunglass  
  456         flipkart     glass2          sunglass
  126         snapdeal     polo1           sunglass  
  486         snapdeal     polo1           sunglass 
  </code></pre>
  
  <p>primary key: id_merchant</p>
  
  <p>merchant table name:pc_merchants</p>
  
  <pre><code>slug |  retailer
  flipkart     Flipkart
  snapdeal     Snapdeal
  </code></pre>
  
  <p>unique key:slug and foreign key for product table</p>
  
  <p>discount table: discount</p>
  
  <pre><code>id|merchant| percentage|category_name
  1  flipkart      5         sunglass
  2  snapdeal      10        sunglass
  </code></pre>
  
  <p>Expected result: when i select any product as per that product's merchant and product's category, percentage should return.</p>
  
  <p>tell me if any changes need to be done between table as foreign key.
  the query i am using is:</p>
  
  <pre><code>select feed_product_name,id_merchant,category_name,percentage 
  from pc_products_merchants m,pc_products p  
  where m.slug = p.id_merchant and product_name LIKE '%glass1';
  </code></pre>
  
  <p>In this query i wanna retrieve percentage also of that product based on its retailer and category by using above 3 tables</p>