Similar questions 1 more →
SQL & Queries


Answer & solution
Answer: C (no official key was published)
1. The Roll_number equality pairs each student with that student's grade records. The Course_number equality pairs each grade with its course.
2. The two filters discard any joined row whose instructor is not Korth or whose grade is not A. Every surviving row therefore witnesses one qualifying course for that student.
3. Projection selects the name and DISTINCT removes repeated names when several qualifying rows exist. It does not test unselected rows or require every course to qualify.
4. Thus a student appears if at least one qualifying Korth-course A exists, C. Requiring all such courses would need a different universal/anti-existence/division construction.
Solution: The joins connect each student to their grade records and the corresponding courses. The filters retain records having grade A in a course taught by Korth. A student's name is produced whenever at least one such joined record exists, and DISTINCT removes duplicate names. There is no universal quantifier, division, or count comparison requiring all courses to qualify. The intended relational query therefore computes option C, names of students with an A in at least one course taught by Korth.