title: How to query sql data from multiple tables
body: <p>How do I query data from multiple tables.<br>
  Example:<br><br></p>
  
  <p>I want to get all info for main_id 1.<br>
  Basically the brand, category, model and SN in a single query.<br></p>
  
  <p><strong>main_table</strong></p>
  
  <pre><code>id brand category model sn
  1....1....2........1....1
  2....2....1........3....2
  3....2....4........5....3
  </code></pre>
  
  <p><strong>brand_table</strong></p>
  
  <pre><code>id....name....main_fk
  1....Apple....1
  2....Sony.....3
  </code></pre>
  
  <p><strong>Category_table</strong></p>
  
  <pre><code>id....name.........main_fk
  1....Electronics...1
  2....Furniture.....4
  </code></pre>
  
  <p><strong>Model_table</strong></p>
  
  <pre><code>id....name....main_fk
  1....Iphone5..1
  2....GoPro3...2
  </code></pre>
  
  <p><strong>SN_table</strong></p>
  
  <pre><code>id....name....main_fk
  1....SN1......1
  2....SN2......2
  </code></pre>