GATE | GATE CS Mock 2018 | Set 2 | Question 61
Consider the following tables :

What will be the output of following SQL query ?
SELECT * FROM EMPLOYEE E WHERE 2 = (SELECT COUNT(DISTINCT E1.SALARY) FROM EMPLOYEE E1 WHERE E1.SALARY>E.SALARY)
(A) Second highest salary
(B) Two distinct salary of employees
(C) Third highest salary
(D) Employee with second highest salary
Answer: (C)
Explanation: Query will give the 3rd highest salary. N-1 = 3-1 = 2
Can be used to find for any value of n.
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 1999 | Question 36
- GATE | GATE CS Mock 2018 | Question 39
- Top 5 Topics for Each Section of GATE CS Syllabus
- How to prepare in Last 10 days to score high in GATE?
- Aptitude | GATE IT 2006 | Question 7
- Aptitude | GATE IT 2006 | Question 8
- GATE | GATE CS 2013 | Question 1
- GATE | GATE CS 2013 | Question 3
- GATE | GATE CS 2013 | Question 4
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 6
- GATE | GATE CS 2013 | Question 7
- GATE | GATE CS 2013 | Question 8
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 65

