For the same tables in P1, for each student, get all the courses that he/she is enrolled in along with the grade he/she scored for each course. Order the result by the student name in ascending order and if there is a tie, break it with the course name in ascending order and if there is a tie break it with the grade in ascending order. The final result should have 3 columns with names (name, course, grade). Submission endpoint:
SELECT DISTINCT students.name AS name,courses.name AS course, grades.grade AS grade
FROM ((grades
INNER JOIN students ON students.id = grades.student_id
INNER JOIN courses ON courses.id = grades.course_id))
ORDER BY students.name ASC, courses.name ASC, grades.grade ASC