283 views
2 votes
2 votes

1 Answer

1 votes
1 votes

(B) seems correct answer!

Employees older than 30 years = e1, e2, e3
Database Projects = P1 and P4
e1 works on = P1 and P5

q1 is Outer query checks for e1
q2 is middle query selects p1 and p4 and checks further
q3 is innermost query, p1 will be selected se e1 works on p1 and p1 is database project.

q3 result is not-null, hence
q2 result is null
finally q1 result is not-null, means e1 is selected.

Related questions

0 votes
0 votes
1 answer
3
rayhanrjt asked Jan 6, 2023
719 views
Write SQL command to find DepartmentID, EmployeeName from Employee table whose average salary is above 20000.
2 votes
2 votes
1 answer
4
Subhrangsu asked Jun 18, 2022
431 views
Write SQL query to show all employees hired on June 4,1984 (non-default format)emp(empno,ename,job,mgr,hiredate,sal,comm,deptno)