535 views
3 votes
3 votes

1)retrieve all name of all employees whose salary is more than minimum salary

2)retrieve all name of all employees from all departments

3)retrieve all name of all employees from all who are working in works

d) retrieve zero rows

1 Answer

Best answer
7 votes
7 votes

Here the key line to watch for is :

If "dept"  table contains  0   rows

then in that case the statement :  "from  dept D , works W" which does the cartesian product of D and W will return 0 rows and hence the result of inner query of ALL() will be empty..And we know :

X  operation  ALL() returns true if  the result of the ALL() is empty..

Hence the condition :   E.salary >  ALL ( the given inner query in the question ) will return true always..

Hence all employee records will be selected regardless of departments..Consequently names of all employees in all departments will be displayed..Alternatively we could have also used NOT IN to achieve the same result..

Hence B) should be the correct answer..Had the clause been "ANY" or "IN"  instead of "ALL" or "NOT IN" in that case D) would have been the answer..

selected by

Related questions

0 votes
0 votes
1 answer
1
Ashutosh_17 asked Mar 30, 2023
906 views
Let R be a relation of degree 5 then the total number of projections possible on R is ___?
3 votes
3 votes
1 answer
4
Hirak asked May 25, 2019
2,135 views
In a relational algebra ∩ is not a basic operator, to make it basic only relational operator we should have areX, – X, UU, –