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.
The EWS quota remain a controversy as its critics says it reduces the size of the open category, besides breaching the 50% limit on the total reservatio...
What does the data from the National Health Profile 2017 show?
Choose the word which is the most opposite in meaning to the word ‘vested’ as used in the passage.
Which of the following is a synonym of the word ‘driven’?
Which of the following statements is true according to the passage?
Which of the following is the theme of the passage?
- "This shift has resulted in a significant number of users forwarding unverified information."
This statement is: Why were all the judges who revolted, were upset with the CJI?
Choose the sentence/s that is/are not true as per the passage.
I. Before British colonization in the late 18th century, villagers owned the vi...
Which of the following statements is definitely false according to the passage ?