title: SQL, DISTINCT product_id, orderQuantity
body: <p>Here is the given question: </p>
  
  <p>Show me a list of the product codes along with the number of times that each code has been ordered (note, order quantity does affect the number of total times ordered); only include product codes that have been ordered at least once? </p>
  
  <p>I have tried the following </p>
  
  <pre><code>SELECT DISTINCT productId, orderQuantity 
  FROM Order
  WHERE (orderQuantity &gt; 0);
  </code></pre>
  
  <p>The table comes up with duplicate product ids. How do I get a table of distinct product ids with the SUM of their order quantities? </p>