title: How to find Project details along with number of working employees?
body: <p>I have two tables <code>Project_details</code> (Pid, Pname, Location) and <code>Emp_details</code> (Eid, Ename, Address, Pid, salary)</p>
  <p><a href="https://i.stack.imgur.com/Uo5Pr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uo5Pr.png" alt="enter image description here" /></a></p>
  <p>Query is to get:</p>
  <ol>
  <li><p>How to find project details along with the number of employees working with them</p>
  </li>
  <li><p>How do we find the details of employee with maximum salary.</p>
  </li>
  </ol>
  <p>For the first query, I can get Pid with number of working employees with them as</p>
  <pre><code>Select Pid, count(Eid) as [no of employees] 
  from Emp_details 
  group by(Eid) 
  order by(count(Eid)) desc; 
  </code></pre>
  <p>For second query this is Okay:</p>
  <pre><code>Select * 
  from Emp_details 
  where salary = (Select max(salary) from Emp_details);
  </code></pre>
  <p>But what if two employees have the same salary, in that case how do we make sure to get details of both employees?</p>