1 flag 3,879 views
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)

  1. Q.1
  2. Q.2
  3. Both Q.1 and Q.2
  4. Neither Q.1 nor Q.2
  • 🚩 Edit necessary | 👮 Akashsr3 | 💬 “Correct Option is D but answer key given B”

1 Answer

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

selected by
Answer:
Position:
Show:

Related questions

3 3 votes
1 answers 1 answer
2.9k
2.9k views
go_editor asked Jul 29, 2016
2,899 views
Match the following $:$$\begin{array} {clcl} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{Secondary Index} & \text{i.} & \text{Functional Dependency}...
4 4 votes
1 answers 1 answer
2.4k
2.4k views
go_editor asked Jul 29, 2016
2,381 views
Armstrong $(1974)$ proposed systematic approach to derive functional dependencies. Match the following w.r.t functional dependencies:$\begin{array}{} & \textbf{List-I} ...
6 6 votes
2 answers 2 answers
7.8k
7.8k views
go_editor asked Jul 29, 2016
7,823 views
Consider the following schemas:Branch=(Branch-name, Assets, Branch-city)Customer = (Customer-name, Bank name, Customer-city)Borrow = (Branch-name, Loan number, Customer a...
4 4 votes
1 1 answer
3.6k
3.6k views
go_editor asked Jul 29, 2016
3,570 views
Consider the following ER diagram:The minimum number of tables required to represent $M, N, P, R_1, R_2$ is2345