title: Simple SQL query to display orders from a specific city with multiple tables, needing a Head of Knowledge
body: <p>The question asks, "Show ID, name and total dollar amount of orders for customers  located in Boston. (label amount as “TotalPurchase”) (Dollar amount of an order is calculated by “Quantity * SalePrice”</p>
  
  <p>When I run the query I get an error stating, "Your query does not include the specified expression 'CID' as part of an aggregate function". Can anyone help me out or explain why I am getting this error?</p>
  
  <p>Also, do i need to join the tables, am i referencing them correctly?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>SELECT Customer.CID Customer.Name, Customer.City, OrderT.CID, OrderItem.ItemID, 
         SUM(OrderItem.Quantity * OrderItem.SalePrice) as TotalPurchase
  FROM Customer, OrderT, OrderItem, Inventory
  GROUP BY Customer.City=’Boston’;
  </code></pre>
  
  <p>and here is a image of the database
  <img src="https://i.stack.imgur.com/xyckw.jpg" alt="enter image description here"></p>