title: How to write SQL query to find max and min salary along with employee name in Oracle
body: <p>I have one employee table. Please find below the table structure along with data.</p>
  
  <p><a href="https://i.stack.imgur.com/iawjf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iawjf.png" alt="enter image description here"></a></p>
  
  <p>I want to find the maximum salary and minimum salary along with employee name.</p>
  
  <p>expected output will be:</p>
  
  <p><a href="https://i.stack.imgur.com/zSyqf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zSyqf.png" alt="enter image description here"></a></p>
  
  <p>To find out the maximum salary along with employee name I have written this query: </p>
  
  <pre><code>SELECT name,salary FROM  employee where salary
  = (select max(salary) from employee);
  </code></pre>
  
  <p>And to find out the minimum salary along with employee name I have written this query:</p>
  
  <pre><code>SELECT name,salary FROM  employee where salary
  = (select min(salary) from employee);
  </code></pre>
  
  <p>But I am unable to merge these two queries. </p>
  
  <p>Can someone please guide me to build the SQL query which will return maximum salary and minimum salary along with employee name?</p>