Question
Which of the following query will return the
third-highest salary from an Employee table in SQL?Solution
To get the third-highest salary, the query SELECT salary FROM Employee ORDER BY salary DESC LIMIT 1 OFFSET 2; fetches the salary value after skipping the top two highest salaries. The outer query ensures that we only get the third-highest salary. Why Other Options are Wrong: a) Incorrect usage of LIMIT; it should be OFFSET 2 instead of LIMIT 2, 1. b) This would return multiple rows or result in an error. c) DISTINCT is unnecessary and could result in wrong data if multiple employees have the same salary. e) This query would return the first three salaries in ascending order, not the third-highest.
How is U related to the mother of V?
Answer the following question based on the direction given below.
If 'A@B' means 'A is father of B'
'A#B' means 'A is daughter of B' ...
Which among the following statement is definitely incorrect?
In a family of six members, L and M are married couple. L's son-in-law is Q's father. P is the brother of O.M is mother of O. Q is daughter of N. How is...
If expression ‘F % G # H $ I & J’ is true, then how is mother in law of J related to V, who is unmarried maternal uncle of H?
How is Umang related to Nisha?
Answer the questions based on the information given below.
Nine persons F, G, H, I, J, K, L, M, and N belong to a family of two generations. No...
Answer the questions based on the information given below:
If A% means A is a male, B($) means B is a female.
A @ B means A and B are si...
How is M related to O?
How is U related to V?