title: MySQL NATURAL JOIN 3 tables related to a parent table with a contraint on the parent table
body: <p>I have 3 child tables that are related to a parent table with the following schema:</p>
  
  <pre><code>Product(maker, model, type)
  PC(model, price, ...)
  Laptop(model, price, ...)
  Printer(model, price, ...)
  </code></pre>
  
  <p>The <code>Product</code> table is the parent table of <code>PC</code>, <code>Laptop</code>, and <code>Printer</code>.
  The three child tables have a foreign key <code>model</code> that reference the <code>Prodcut</code> table.
  Also, PC, Laptop, and Printer don't have identical schemas.</p>
  
  <p>I want to find out the best way to <code>SELECT</code> the model and price of all the products(pc, laptop, and printer) that are made by a certain maker.</p>
  
  <p>I'm new to SQL and my  intuition right now tells me that I should join the parent table to each of the child tables, filter the results, and then perform a union. The query appears to return the correct result.</p>
  
  <p>Here is my query:</p>
  
  <pre><code>SELECT model, price FROM Product NATURAL JOIN PC WHERE maker = 'B' UNION 
  SELECT model, price FROM Product NATURAL JOIN Laptop WHERE maker = 'B' UNION 
  SELECT model, price FROM Product NATURAL JOIN Printer WHERE maker = 'B';
  </code></pre>
  
  <p>Is this an effective way to query for my information? I feel like I'm typing way too much and repeating much of the same constraints to achieve my result.</p>
  
  <p>Is there a better query I could write?</p>
  
  <p>Thanks.</p>