we can rewrite the given query as
select distinct(Name)
from Students
where Roll_number in
(select Roll_number
from Grades
where Grade='A' and Course_number in
(select course_number
from Courses
where instructor='Korth'))
Here the inner most query returns the course_number of courses taught by korth.
the 2nd inner query(highlighted in bold) returns the Roll_number of students who got a A grade in at least 1 course taught by korth.(Due to IN operator)
The outermost query returns the unique names of those students.
Hence option c is the answer.
query for option A:
select distinct(Name)
from Students where
Roll_number in
(select Roll _number
from Grades ,Courses
where Grade='A' and Course.Course_number=Grade.Course_number and Instructor='Korth'
group by Roll_number
having count(*)=(select count(*) from Courses where instructor='Korth'))
query for option B:
select distinct(Name)
from students
where Roll_number in
(select Roll _number
from Grades
where Grade='A'
group by Roll_number
having count(*)=(select count(*) from Courses )
Hope this clears :)