I don't agree that we need more information to be honest. Something like this should work. Another way would be two queries and using the MINUS
keyword to get all results from the first query (students in classes x, y and z), except the results from the second query (students in classes a, b and c).
Selecting all students that are in ALL of classes x, y and z, and in NONE of classes a, b and c.
SELECT * FROM Students s
WHERE EXISTS (SELECT * FROM Enrollment
WHERE studentId = s.StudentId AND ClassId = 'x')
AND EXISTS (SELECT * FROM Enrollment
WHERE studentId = s.StudentId AND ClassId = 'y')
AND EXISTS (SELECT * FROM Enrollment
WHERE studentId = s.StudentId AND ClassId = 'z')
AND NOT EXISTS (SELECT * FROM Enrollment
WHERE studentId = s.StudentId AND ClassId IN ('a', 'b', 'c')