3 3 votes Consider the table student (stuid, name, course, marks). Which one of the following two queries is correct to find the highest marks student in course 5? Q.1. Select S.stuid from student S where not exist (select * from student e where e course ='5' and e marks $\geq$ s marks) Q.2. select s.stu.id From student S where s.marks > any (select distinct marks from student S where s.course =5) Q.1 Q.2 Both Q.1 and Q.2 Neither Q.1 nor Q.2 Databases ugcnetcse-dec2013-paper3 databases sql + – 🚩 Edit necessary | 👮 Akashsr3 | 💬 “Correct Option is D but answer key given B” go_editor 3.9k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 1 1 vote 1. Select S.stuid from student S where not exist (select * from student e where e course ='5' and e marks ≥ s marks) = false Select S.stuid from student S where not exist (select * from student e where e course ='5' and e marks > s marks) = correct Q.2. select S.stuid From student S where s.marks > any (select distinct marks from student S where s.course =5) = false select S.stuid From student S where s.marks >All (select distinct marks from student S where s.course =5) = correct Ans is D Prashant. answered Jul 29, 2016 • selected Nov 20, 2016 by Resmi Arjun 1 Prashant. comment Share Follow See all 3 Comments 3 3 Comments reply Prashant. commented Jul 29, 2016 reply Follow flag @srestha check this. 0 0 replyShare srestha commented Jul 29, 2016 reply Follow flag @Anirudh yes both false But Q1 will be emarks<smarks Q2. select s.stu.id From student S where s.marks where not exists> any (select distinct marks from student S where s.course =5) correct me if wrong 0 0 replyShare Prashant. commented Jul 29, 2016 reply Follow flag we are select smarks so s marks is not less then any other then inner query is empty ans will be selected. for Q2: select s.stu.id From student S where s.marks where not exists> any (select distinct marks from student S where s.course =5) m not confirm since 1st time saw not exist > any 0 0 replyShare Please log in or register to add a comment.