Skip
Arish's avatar

225. Practice - EXISTS 2


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);