György Varga19,198 Points
Here is my solution where you don't need to check the subjects table if that the name of the subjects start with uppercase or lowercase letter.
SELECT DISTINCT teachers.id, teachers.first_name, teachers.last_name FROM teachers INNER JOIN classes ON teachers.id = classes.teacher_id INNER JOIN subjects ON classes.subject_id = subjects.id WHERE subjects.grade = 7 AND UPPER(subjects.name) = UPPER("sCieNce");
Steven Parker201,997 Points
You've definitely discovered the way to eliminate case sensitivity.
LOWER would also do the same job. But you don't need to use the function twice when comparing literals, just be sure your literal matches the case you're converting to:
WHERE subjects.grade = 7 AND UPPER(subjects.name) = "SCIENCE";