GATE CSE
First time here? Checkout the FAQ!
x
+6 votes
255 views

Plz explain both queries!

asked in Databases by Boss (9.7k points)  
retagged by | 255 views
@dbashish, yes.
I will say again go the link. There one comment is done by arjun sir, really an excellent one, where he has used a set and explained what anyone means. Read all comments.
Yes correct. I said so seeing the discussions going on here previously. Sorry!!
@habibkhan can you tell me this
why are you mentioning my name here??..i hadn't commented or answered here....

are you asking me to verify this???
see, neither "s2.rank<=s1.rank" nor "s2.rank<s1.rank" will work...

in case of "s2.rank<=s1.rank"...s1 will be selected only if it is less than everyone...moreover there is one more problem in this query, 'what if s1 is from CSE department, than he will never get selected because there will come a point where comparison s1.rank<=s1.rank will be done and  therefore notexist will contain some tupple and s1 will not be selected...

in case of "s2.rank<s1.rank"...s1 will not be selected  if it is greater than anyone in cse(or we can say s1 will be selected only if it less than or equal to everyone)...

Please log in or register to answer this question.



Top Users Aug 2017
  1. Bikram

    5276 Points

  2. ABKUNDAN

    4730 Points

  3. akash.dinkar12

    3526 Points

  4. manu00x

    3492 Points

  5. rahul sharma 5

    3188 Points

  6. makhdoom ghaya

    2700 Points

  7. just_bhavana

    2432 Points

  8. stblue

    2244 Points

  9. Tesla!

    2090 Points

  10. pawan kumarln

    1876 Points


25,074 questions
32,230 answers
75,116 comments
30,239 users