Consider the following schema: Student (Sid, Sname, age) Course Info (Cid,…

Consider the following schema:

Student (Sid, Sname, age)

Course Info (Cid, Cname, Instructor SSN)

Enroll (Sid, Cid, grade).

Choose all SQL queries for “Find names of students who enrolled for all courses”

  1. A.

    Select S.Sname FROM STUDENT S WHERE NOT EXISTS (Select C.Cid from course Info C WHERE NOT EXISTS (Select E.Cid FROM ENROLL E WHERE E.Cid = C.Cid And E. Sid = S.Sid))

  2. B.

    Select S.Sname FROM STUDENT S WHERE EXISTS (Select C.Cid from course Info C WHERE EXISTS (Select E.Cid FROM ENROLL E WHERE E.Cid = C.Cid And E.Sid = S.Sid))

  3. C.

    Select S.Sname FROM STUDENTS WHERE EXISTS (Select C.Cid from course Info C WHERE NOT EXISTS (Select E.Cid FROM ENROLL E WHERE E. Cid = C. Cid And E. Sid = S.Sid))

  4. D.

    None of the above

Attempted by 112 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…