title: how to display employees, their salaries and the average for the department?
body: <p>I have a table with employees names, salaries and departments id. How can I display their list with name, salary and average salary in employee's department in one table? </p>
  
  <p>e.g. </p>
  
  <pre><code>name  | sal  | av. sal.
  ------+------+--------
  Smith | 1500 | 2000
  </code></pre>