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 many districts of India is recognised as Aspirational District?
निम्नलिखित में से कौनसा तत वाद्य नही है ?
The hosting country for “Climate and Development Summit” to be held in March 2021 is?
Consider the following statements:
1. The design of the National Flag was adopted by the Constituent Assembly of India on 22 July 1947.
2....
Hero MotoCorp has unveiled a new brand named, __________, for its electric vehicles.
Which river is the longest in the world?
Find the odd figure out:
Which of the statement is not true in regards to the health system during the Panwar dynasty:
Which is the fastest transmission media?
The Union Home Minister Amit Shah has unveiled a 120 feet tall statue of a polo player in which state?