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.
In data management, what role does metadata play when working with a large dataset of customer transactions?
Which type of data visualization is most useful for identifying the relationship between two continuous variables?
Which of the following best defines the role of a data analyst in an organization?
During the data analysis process, which of the following steps is primarily focused on removing inaccuracies and ensuring the dataset's reliability?
During the data analysis process, which step is crucial for ensuring data accuracy before any modeling or interpretation?
Why is metadata critical for managing large datasets?
Which condition must be satisfied for Kruskal’s Algorithm to function correctly?
Which of the following is NOT an effective strategy to minimize bias in sampling?
A time series dataset shows monthly sales data for a retail store over the last three years. After performing decomposition, you observe that the residu...
A data analyst is tasked with understanding customer churn for a subscription-based business. Which of the following steps should they prioritize immedi...