title: MySQL query to show salary depending on department
body: <p>I am stuck with a peculiar problem. I have tried almost everything that I know.
  The table contains the following details:</p>
  
  <pre>
  +--------+---------+--------+----------+
  | emp_id | dept_no | salary | emp_name |
  +--------+---------+--------+----------+
  |      1 | c1      |  12300 | Rajesh   |
  |      2 | c2      |  45123 | Arvind   |
  |      3 | c3      |  12345 | Ravi     |
  +--------+---------+--------+----------+
  </pre>
  
  <p>The expected output is like this :</p>
  
  <pre>
  +---------+--------+--------+--------+
  | Dept_no | DeptC1 | Deptc2 | DeptC3 |
  +---------+--------+--------+--------+
  | c1      |  12300 |      0 |      0 |
  | c2      |      0 |  45123 |      0 |
  | c3      |      0 |      0 |  12345 |
  +---------+--------+--------+--------+
  </pre>
  
  <p>I am really stuck with this problem and have no idea how to solve this. I was trying to solve this with left outer joins but was not able to do it. </p>