title: SQL query: find each item that costs more than the average and how much more
body: <p>I'm doing some revision for a databases exam and one of the questions is as follows:</p>
  
  <p>Given the table <code>Items</code> (columns: <code>itemid</code>, <code>description</code>, <code>unitcost</code>), formulate a query to find each item that costs more than the average and how much more than the average it costs.</p>
  
  <p>My answer so far is </p>
  
  <pre><code>SELECT itemid, 
         description, 
         unitcost - AVG(unitcost) 
  FROM Items 
  WHERE unitcost &gt; (SELECT AVG(unitcost) FROM Items)
  </code></pre>
  
  <ul>
  <li>Would this work? From what I understand, expressions are allowed in the list of selected columns but I'm not sure if that extends to the use of functions like <code>AVG()</code>.</li>
  <li>Is there a cleaner, clearer way to express the same thing? Preferably using only ISO SQL constructs because my course is rather theoretical and not connected to any specific dialect.</li>
  </ul>
  
  <p>Thanks friends :)</p>