Write a query to find the name of the student(s) who has scored maximum mark in Software Engineering. Sort the result based on name.
This is what I tried.
You can try this code. It must work perfectly :
select s.student_name
from student s
join mark m
on s.student_id=m.student_id
join subject s1
on s1.subject_id=m.subject_id
where m.value=(select max(m1.value) from mark m1
join subject s2
on s2.subject_id=m1.subject_id
where lower(s2.subject_name)='software engineering'
group by s2.subject_id)
group by s.student_name
order by s.student_name;