Skip to content

Commit

Permalink
Update find-top-scoring-students.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 authored Jun 19, 2024
1 parent 5867d93 commit a3fdf5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MySQL/find-top-scoring-students.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WITH best_enrollments_cte AS (
GROUP BY 1, 2
ORDER BY NULL
), major_grade_a_count_cte AS (
SELECT s.student_id, s.major, COUNT(*) AS cnt
SELECT s.student_id, s.major, COUNT(*) AS cnt
FROM best_enrollments_cte e INNER JOIN students s ON e.student_id = s.student_id INNER JOIN courses c ON e.course_id = c.course_id
WHERE s.major = c.major AND e.grade = 'A'
GROUP BY 1
Expand Down

0 comments on commit a3fdf5c

Please sign in to comment.