SQL query to find student with maximum marks per department
Filed under OYO
The question
Given a table with student id, student name, department, and mark, write an SQL query to retrieve the student name with the highest marks in each department.
No write-up yet. Related questions below have one.
Related OYO questions
Collected from public candidate posts and coding forums. Updated Nov 2026.