SQL SUBQUERY: Exercise-22 with Solution
Write a query to display the department id and the total salary for those departments which contains at least one employee.
Sample table: employees
Sample table: departments
Sample Solution:
Sample Output:
department_id total_amt 10 4400.00 20 19000.00 30 24900.00 40 6500.00 50 156400.00 60 28800.00 70 10000.00 80 304500.00 90 58000.00 100 51600.00 110 20300.00
N.B. : In certain instances not null is removed in table structure, so results may vary.
Pictorial Presentation:
No comments:
Post a Comment