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.
A body moves with uniform acceleration and covers 80 m in 4 s and 160 m in next 4 s. Find initial velocity.
Which instrument is primarily used to measure the relative density of liquids by utilizing the principle of buoyancy?
If a force is applied to two stationary objects with different masses for the same duration, what will be the same for both objects?
A wire loop in the shape of a square of side a carries a current I. If an infinitely long straight wire carrying the same current passes through the ce...
'Shock-absorbers are usually made of steel as it –
The distance between the focus and the centre of curvature of a spherical mirror in terms of the radius of curvature R, is equal to:
Two spherical soap bubbles of radii r1 and r2 coalesce to form a bubble of radius R. If surface tension of soap solution is T, atmospheric pressure is P...
Bernoulli's Principle is derived from which fundamental law?
In an AC circuit, voltage and current are given by V = 200 sin(ωt) and I = 10 sin(ωt + π/3). What is the average power consumed?
Which mirror always forms virtual, erect, and diminished image?