Home » Database » Database miscellaneous » Question

Database miscellaneous

  1. Consider the set of relations shown below and the SQL query that follows:
    Students: (Roll_number, Name, Data_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 Grades.grade
    and courses. Instructor = korth
    and Courses.course - number = Grades.course - number
    Roll_number = Grades.Roll_number and Grades.grade = A
    Which of the following sets is computed by the above query?
    1. Names of students who have got an A grade in all courses taught by Korth
    2. Names of students who have got an A grade in all courses
    3. Names of students who have got an A grade in at least one of the courses taught by Korth
    4. None of the above
Correct Option: C

The relations are as given,
Students: (Roll_number, Name, Date_of_birth)
Courses: (Course number, Course_name, Instructor)
Grades: (Roll_number, Course_number, Grade)
Now, the distinct name is to be selected, where
1. Name of the student is selected on the basis of the grade.
2. Instructor of the course in Korth.
3. Courses selected on the basis of grade.
4. Grade should be A.
The query thus, computed is name of the students who gets A grade in atleast one of the courses taught by Korth .



Your comments will be displayed only after manual approval.