Consider the set of relations given below and the SQL query that follows…
2018
Consider the set of relations given below and the SQL query that follows
Students : (Roll number, Name, Date of birth)
Courses: (Course number, Course name, instructor)
Grades: (Roll number, Course number, Grade)
SELECT DISTINCT Name
FROM Students, Courses, Grades
WHERE Students.Roll_number = Grades.Roll_number
AND Courses.Instructor =Sriram
AND Courses.Course_number = Grades.Course_number
AND Grades.Grade = AWhich of the following sets is computed by the above query?
- A.
Names of Students who have got an A grade in all courses taught by Sriram
- B.
Names of Students who have got an A grade in all courses
- C.
Names of Students who have got an A grade in at least one of the courses taught by Sriram
- D.
None of the above
Attempted by 212 students.
Show answer & explanation
Correct answer: C
The SQL query joins the Students, Courses, and Grades tables. It filters for courses taught by 'Sriram' where the grade is 'A'. The query selects distinct student names from this filtered set. Therefore, it returns the names of students who have received an 'A' in at least one course taught by Sriram.
A video solution is available for this question — log in and enroll to watch it.