Skip to content
Advertisement

Write a query to display the student names and the maximum mark scored by them in any subject

I have tried using group by and getting an error message of single row function cannot return multiple values.

It has three tables to be selected student, subject and mark.

enter image description here

Advertisement

Answer

If you only required student_id and MAX number, you can use only tables Student and Marks as below-

But if you need subject name as well, you can try this below logic-

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement