2,916 views
3 votes
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

1 Answer

Best answer
1 votes
1 votes

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:

Related questions

3 votes
3 votes
1 answer
1
go_editor asked Jul 29, 2016
2,271 views
Match the following $:$$\begin{array} {clcl} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{Secondary Index} & \text{i.} & \text{Functional Depende...
3 votes
3 votes
1 answer
2
go_editor asked Jul 29, 2016
1,762 views
Armstrong $(1974)$ proposed systematic approach to derive functional dependencies. Match the following w.r.t functional dependencies:$\begin{array}{} & \textbf{List-I} ...
4 votes
4 votes
1 answer
4
go_editor asked Jul 29, 2016
2,452 views
Consider the following ER diagram:The minimum number of tables required to represent $M, N, P, R_1, R_2$ is2345