title: What is the best way to show products based on two criterias (MySQL + Schema + maths)
body: <p>I am building a e-commerce website using MySQL. I am stuck with the following.</p>
  
  <p>I have the </p>
  
  <pre><code>**products** table:  
      id  | sku 
  
  **stocks** table:  
  id  | product_id |quantity 
  
  **orders** table:  
  id  | status     | products 
  </code></pre>
  
  <p>I want to know the best way to make SQL query that brings me the products that have 1 or more quantity. To get the quantity of a product: first you get the id from <strong>products</strong>, then you check the amount in <strong>stocks</strong> (a product_id can have more than 1 row, I want to add a new row everytime that our store recieve new stock) and subtract the total times that product_id appears on <strong>orders</strong> table and that row status is 3.</p>
  
  <p>Or if you can suggest me a better way to do this, it would be awesome.</p>
  
  <p>Really appreciate any help here.
  Thanks!</p>