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.
‘Ganymede’, a natural satellite of ___________, is the largest and most massive of the Solar System's moons.
According to the UNFPA's 'India Ageing Report 2023,' what percentage of India's total population is projected to be aged 60 years and above by the year ...
Which hijacked ship's Bulgarian nationals were assured by Prime Minister Narendra Modi to return home soon after being rescued by the Indian Navy?
During port calls in the southwest Indian Ocean, INS Shardul conducted joint patrolling and EEZ surveillance with which partner?
Which two entities sold a combined 4.9% stake in PNB Housing Finance?
How many Village Councils in Mizoram received allocations under XV Finance Commission grants for 2025–26?
What was the primary reason behind the 9.4% shrink in India’s trade deficit in Q1 2025-26?Â
Which institution was declared as a deemed university by the Ministry of Education?Â
Which company’s subsidiary has launched a bonds platform for retail investors in India to enable retail investors to invest in three types of bonds - ...
What platform is being used by the government to track and manage measles-rubella vaccination digitally?