Consider the following three table to store student enrollements in different courses.
Student(EnrollNo, Name) Course(CourseID, Name) EnrollMents(EnrollNo, CourseID)
What does the following query do?
SELECT S.Name FROM Student S, Course C, Enrollments E WHERE S.EnrollNo = E.EnrollNo AND C.Name = "DBMS" AND E.CourseID = C.CourseID AND S.EnrollNo IN (SELECT S2.EnrollNo FROM Student S2, Course C2, Enrollments E2 WHERE S2.EnrollNo = E2.EnrollNo AND E2.CourseID = C2.CourseID C2.Name = "OS")
(A)
Name of all students who are either enrolled in "DBMS" or "OS" courses
(B)
Name of all students who are enrolled in "DBMS" and "OS"
(C)
Name of all students who are either enrolled in "DBMS" or "OS" or both.
(D)
None of the above
Answer
Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!