Question
Which of the following SQL queries is used to find the
second highest salary from an employee table? SELECT MAX (salary) Â Â Â Â Â Â Â FROM employee WHERE salary < ( SELECT MAX (salary) FROM employee);Solution
The query uses a nested SELECT statement to retrieve the second-highest salary from the employee table. Let's break it down:
- Inner query: SELECT MAX(salary) FROM employee retrieves the highest salary in the employee table.
- Outer query: The WHERE salary < (SELECT MAX(salary) FROM employee) ensures that only those salaries smaller than the highest salary are considered, and the outer MAX(salary) retrieves the largest salary from that set, effectively giving the second-highest salary.
- B is incorrect because the query does not return the highest salary but rather the second-highest salary by excluding the maximum salary.
- C is incorrect because nested SELECT statements are valid in SQL and do not cause errors here.
- D is incorrect because the query will return a value unless there are no records in the employee table.
- E is incorrect because the query will return a single value—the second-highest salary.
As per RBI guidelines, ‘Bulk Deposit’ in the case of RRBs mean a Single Term Deposit of _______ and above.
Which of the following points are ‘correct’ with respect to the National Disaster Management Authority (NDMA)?Â
Which of the following best captures the purpose of Gross Value Added (GVA)?
In the Union Budget 2024-25, the Finance Minister declared to set up a Venture Capital Fund of ________ for expanding the Space Economy in the next 10 y...
Which state is not amongst the 31 states where Aspirational block program is being implemented?
Under Ayushman Bharat –Health and Wellness Centres (AB-HWCs), what healthcare services are provided free of cost to all citizens of the country?
Which of the following is not the role of an Independent Director?
Which of the following is/are the correct conditions for receiving Second Instalment under the Pradhan Mantri Matru Vandana Yojana (PMMVY)?
I-...
How many schools are targeted for upgradation under PM-SHRI?
Which of the following Statements about Priority Sector Lending is/are True?
I- PSL norms are decided by the RBI after discussion with the Cabine...