6 votes 6 votes Plz explain both queries! Databases databases sql + – Lokesh . asked Jan 12, 2017 • retagged Aug 5, 2017 by Arjun Lokesh . 1.3k views answer comment Share Follow See all 18 Comments See all 18 18 Comments reply Show 15 previous comments akshay_845 commented Jan 25, 2017 reply Follow Share @habibkhan can you tell me this 0 votes 0 votes joshi_nitish commented Jul 9, 2017 reply Follow Share why are you mentioning my name here??..i hadn't commented or answered here.... are you asking me to verify this??? 0 votes 0 votes joshi_nitish commented Jul 9, 2017 reply Follow Share 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)... 0 votes 0 votes Please log in or register to add a comment.