title: Not confident in SUM and not sure how to limit a field
body: <p>Trying to write a SELECT statement for a homework problem. I added a SUM function but not sure it can be used that way. As well as having 3 JOINs because the tables are distant from each other. Honestly if any of my current code is incorrect please tell me. But my main focus is how to limit the field "discontinued" in the table.</p>
  
  <p>The question is: Draw from the sales data model to prepare a statement showing customer first name, customer e-mail address, product name, and total units, where total units is the sum of units in stock and units on order. Limit records to orders not discontinued (i.e., 'N' from the discontinued field). Create an alias for each field in the SELECT clause, including “Total Units” for the calculated column. Create and use an alias for each table in the FROM clause. Sort by total units.</p>
  
  <p>The table: <a href="https://imgur.com/rdZthcH" rel="nofollow noreferrer">https://imgur.com/rdZthcH</a></p>
  
  <pre><code>SELECT customerFN AS “First Name”, customerEmail AS “Email”, productName AS “Product Name”,
  (SUM(unitsInStock)+SUM(unitsonorder)) AS "Total Units"
  FROM customer c
  JOIN order o
  ON c.customerID = o.customerID
  JOIN orderLine l
  ON o.orderID = l.orderID
  JOIN product p
  ON l.productCode = p.productCode
  WHERE 
  </code></pre>
  
  <p>There is nothing after the WHERE clause because the code is incomplete. The code is incomplete because I believe that I need a WHERE clause of some sort to limit the "discontinued' field. I just don't know how to do that. I've looked up Where clauses and I think it would use >&lt; or !=. But I don't know the function.</p>