Consider a database that has the relation schemas: student(rollno, name,…
Consider a database that has the relation schemas:
student(rollno, name, degree, year, gender)
course(courseid, cname, credit, dept)
enroll(rollno, courseid, session, grade)
Assume that every student is enrolled in at least one course, then which of the following queries retrieves the names of all students who have scored ‘A’ in all the subjects they enrolled in:
- A.
SELECT s.name FROM student s WHERE NOT EXISTS (SELECT e.rollno FROM enroll e WHERE e.rollno = s.rollno AND e.grade ≠ 'A' )
- B.
SELECT c.cid FROM course c WHERE EXISTS (SELECT cid FROM enrolled e WHERE e.cid = c.cid AND e.grade = 'A' )
- C.
SELECT c.cid FROM course c WHERE NOT EXISTS (SELECT cid FROM enrolled e WHERE e.cid = c.cid AND e.grade = 'A' )
- D.
none of the above
Attempted by 160 students.
Sign up free to check your answer
Sign up freeLoading lesson…

