Question
Which SQL query would return the top three departments
with the highest total salaries from an employees table with columns department , salary , and employee_id ?Solution
Explanation: The correct query uses SQL’s GROUP BY to aggregate data by department , calculates the sum of salary for each department using SUM(salary) , and orders the results in descending order with ORDER BY . Finally, the LIMIT 3 clause retrieves only the top three departments. This approach is efficient and aligns with database query standards, ensuring the highest salaries are calculated accurately and in rank order. Option B: MAX(salary) cannot be used without a GROUP BY clause for the entire table, and the syntax is incorrect. Option C: COUNT(salary) measures frequency, not total salary. Option D: DISTINCT eliminates duplicates but does not aggregate data for rankings. Option E: MAX(salary) sorts by individual highest salaries, not aggregated totals, leading to incorrect results.
Directions : An idiom/phrase is given in bold. Following this idiom/phrase are given three sentences, which use the given idiom/phrase. The idiom/phras...
In the question below, a sentence is given with a part missing. From the options below, choose the correct combination of idioms that can fit in the bl...
In the following question a proverb/idiom us given. Select the option that best describes the meaning of the given proverb/idiom.
The early bir...
If the bail is……………………., it is not within the playing area.
In each of the following questions, an idiomatic expression/a proverb has been underlined – followed by four alternatives. Choose the one which best ...
Select the most appropriate meaning of the given idiom.
dance to someone's tune
Bite your tongue
On the issue of marriage, Sarita put her foot down .
When two heavyweights have an argument, its best to sit on the fence and not make either of the turn against you.
In the following question, an idiomatic expression or a proverb has been given in bold—followed by four alternatives. Choose the one which best expre...