edited by
1,256 views
1 votes
1 votes

According to me it should be – “Retrieve the names of all students with a lower rank, than all students with age < 18 ”

edited by

1 Answer

1 votes
1 votes
the right answer would be D .

what you are saying is answer should be "retrieve the name of all student with lower rank than all student of age 18"

which is wrong because here you are just replacing NOT EXISTS with EXISTS FOR ALL.

NOT EXISTS means( for ALL) (NOT EXIST ) that is internal query or subquery tuples( inside NOT EXISTS) should not be true for  any outer query tuple..

 

we can conclude our answer by breaking into some logical sentences , here is my approach

point 1:consider student s1 and s2 two group of students(basically same students recognize by two different group name)

point 2:for every student in s1 we will check for each student in s2(corelational subquery)

for particular students s1.a

NOT EXISTS will return false  if THERE EXIST a group 2 student with age<18 AND rank >s1.a

NOT EXISTS will return true  if for all students of s2 with age <18 have rank<s1.a

so we can say query return the name of students who has higher  rank than all student with age <18

note: answer might be assuming all ranks are unique otherwise the correct statement would be "name of students who have rank higher than or equal to all student with age<18"

surely if same options were given in multiple select type question this year you should not choose any .(my opinion)
edited by

Related questions

0 votes
0 votes
0 answers
2
Tuhin Dutta asked Dec 15, 2017
397 views
Student tableROLLNONAMEMARKS1MARKS21T50302S70993DNULL10NULLNULL78NULLNULLNULLNULLNULLa) select count(MARKS1) from student;b) select count(*) from student;
0 votes
0 votes
1 answer
3
Na462 asked Jun 29, 2018
806 views