in Databases
263 views
0 votes
0 votes

why doesn’t the option D is correct .it is not the case that always 2nd highest salary employee will be selected

in Databases
263 views

4 Comments

At first you are comparing between E1 and E2 and then u r comparing with E2 and E3..so off course there is an indirect  comparison between E1 and E3.
0
0
Nope. Here there is no comparison between E1 and E3, direct or indirect. Here they are saying, E2.sal> E1 and for all E3, E2.sal >= E3.sal

Now E1.sal can be greater than E3.sal or it can be less than E3.sal. Don't let the question trick you. TAKE AN EXAMPLE AND SEE.

emp no. 1,2,3

Salary 30k, 20k, 10k

Here 10k will also be selected.

If E2 is at 30k, E1 is at 10k, E3 will iterate over all 3 rows.
0
0
ya i got my mistake..its a corelated query..i missed this part out..thanks!
0
0

Please log in or register to answer this question.

Related questions

0 votes
0 votes
2 answers
2