There are two tables with the columns shown in brackets.
a. Employee(emp_id,emp_name,emp_salary,emp_dept_id)
b.Department(dept_id,dept_name)
Write a SQL to show the total salary for each department
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rahul BhattPosted Jul 21, 2012, 1:41 AM
select TableB.dept_name, SUM(TableA.emp_salary) from Employee as TableA
Inner join Department as TableB
on TableA.emp_dept_id = TableB.dept_id
Group by TableB.dept_name
Satyapriya NayakPosted Jul 21, 2012, 1:26 AM