Exercise: High Achievers
Find students with at least one A grade.
Solution
sql
1SELECT DISTINCT name FROM students s
2WHERE EXISTS (
3 SELECT 1 FROM grades WHERE student_id = s.id AND grade = 'A'
4);
Find students with at least one A grade.
1SELECT DISTINCT name FROM students s
2WHERE EXISTS (
3 SELECT 1 FROM grades WHERE student_id = s.id AND grade = 'A'
4);