title: How to calculate percentage in column?
body: <p>I've got a task to calculate smallest salary in the departments and how many percents is it from total salary.
  Also i can use only one select statement and <strong>probably</strong> I need to use window functions.</p>
  
  <p>This is how i started:</p>
  
  <pre><code>     SELECT distinct department_id,
       min(salary) over(partition by department_id) as min_sal
       FROM employees;
  </code></pre>
  
  <p>But if I use RATIO_TO_REPORT function it show all table, not grouped by department_id.</p>