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.
Which of the following Statements about IREDA is/are True?
I- It is registered as Non-Banking Financial Company (NFBC) with Reserve Bank of India...
Which of the following Statements about Multiplier Effect is/are True?
I- When the government spends a rupee, overall income rises by a multiple ...
Who among the following is not one of the eligible beneficiaries of PMUY?
Consider the following statements regarding Phase II of the Swachh Bharat Mission (Grameen) [SBM (G)]
1) The program will be implemented...
Which of the following statements about Prompt Corrective Action is/are True?
I-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Prompt Corrective Action F...
When Government expenditure is more than income, through which of the following ways, it does the deficit financing?
(1) From Banks
(2) Fr...
What is the basic difference between Gross NPA and Net NPA?
I- Gross NPA is the total of Bank loans and Net NPA is the total of all kinds of loan...