GATE CS 2003 · SQL Queries

MCQ · 1 mark · Problem DBMS-SQL-0147

Consider the set of relations shown below and the SQL query that follow:
Students:(Roll_number,Name,Date_of_birth)
Courses:(Course_number,Course_name,Instructor)
Grades:(Roll_number,Course_number,Grade)
select distrinct Name from Students, Courses, Grades Where Students.Roll_number=Grades.Toll_number and Courses.Instructor= 'Korth'
and Courses.Course_number=Grades.Course_number
and Grades.grade= 'A'
Which of the following sets is computed by the above query?
  1. A
    Names of students who have got an A grade in all courses taught by Korth
  2. B
    Names of students who have got an A grade in all courses
  3. C
    Name of students who have got an A grade in at least one of the courses taught by Korth
  4. D
    None of the above

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solutionOfficial GATE Answer Key: Option C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/969/gate2003-86

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com