Question 11
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")
Question 12
Consider the following Employee table
ID salary DeptName 1 10000 EC 2 40000 EC 3 30000 CS 4 40000 ME 5 50000 ME 6 60000 ME 7 70000 CS
How many rows are there in the result of following query?
SELECT E.ID FROM Employee E WHERE EXISTS (SELECT E2.salary FROM Employee E2 WHERE E2.DeptName = \'CS\' AND E.salary > E2.salary)
Question 13
Question 14
Question 15
Question 16
S1: It causes minimum average waiting time S2: It can cause starvation
Question 17
Question 18
There are 18 questions to complete.