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.
Which company has recently received DoT approval to operate satellite internet in India, becoming the third such company?
What is the primary focus of the Memorandum of Understanding (MoU) between NTPC Green Energy Limited (NGEL) and Nayara Energy?
TranslateGemma supports how many fully trained and evaluated languages?Â
What is the name of the fixed airfare scheme launched by the Government of India through Alliance Air?
Who won the men's title at the Fenesta National Tennis Championship in 2024?
Who authored the book "Hind Swaraj" or "Indian Home Rule"?
Which country did Saudi Arabia appoint its first ambassador to since 2012, as part of efforts to normalize diplomatic relations?
'Dance to Decarbonise' event was recently organised by which ministry?
What policy is the Ministry of Finance planning to implement to improve the efficiency of Regional Rural Banks (RRBs)?
What is the name of the measles and rubella vaccine launched by Indian Immunologicals (IIL) for children, and where was it launched?