title: to display name,department name,marks of top performer(s) in Software Engineering,ordered by department name in ascending order
body: <p>Write a query to display the name, department name and marks of the top performer(s)  in Software Engineering , ordered by department name in ascending order.</p>
  
  <p>I have used below query but didn't getting desired result showing me two students from different department with same marks in software engineering</p>
  
  <pre><code>select distinct a.student_name,b.department_name,c.value from student a
  inner join department b on a.department_id=b.department_id
  inner join mark c on c.student_id=a.student_id and c.value in
  (select max(a.value) from mark a,subject d where a.subject_id=d.subject_id
  and d.subject_name='Software Engineering')
  order by b.department_name;
  </code></pre>
  
  <p><a href="https://ibb.co/QDnJg7n" rel="nofollow noreferrer">please refer the schema</a></p>