SQL: Department Salary Budget
Medium
SQL — Aggregation
SQL
SUM
GROUP BY
Calculate total salary budget per department.
Constraints
Write standard SQL (MySQL 8.0 compatible).
Examples
Example 1:
Input: dept salary
IT 5000
IT 6000
HR 4000
Output:
Example 2:
Input: dept salary
IT 5000
IT 6000
HR 4000
Output:
Hints
SUM with GROUP BY.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console