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.
What's the name of the technology that the Chrome browser uses to keep you safe from malware and phishing?
HTML stands for
Which of these options will keep your online information safest?
A basic computer network can be described as:
Which of the following define a page break?
Which of the following combinations of the keys are used to restart the computer?
_______________ can detect computer files whose contents are broken across several locations on the hard disk, and move the fragments to one location ...
In database, a fields is a
_______ is the execution of data in a short time period, providing near-instantaneous output
What in-house creation did Google use as a programming interface for Chrome before making the shift to HTML5?