I have a Employee table with columns
ename,eid,salary,deptno. How to retrieve sum of salary for
each deptno?

Answer Posted / sudarsan

SELECT
DeptNo AS Department,
Count(DeptNo) AS Dept_Count,
Sum(Salary) AS Salary_DeptWise FROM Employee
GROUP BY DeptNo

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is big data nosql?

514


Are subqueries better than joins?

536


Why we use stored procedure instead of query?

538


Where do we use pl sql?

555


How do you explain an index?

790






What are the types of variables use in pl sql?

511


How many types of functions are there in sql?

505


What is the difference between joins?

536


What is rownum?

540


What do you mean by dbms? What are its different types?

557


What does pl sql stand for?

657


What is keys and its types?

543


What is difference sql and mysql?

535


explain the difference between delete , truncate and drop commands? : Sql dba

550


what are local and global variables and their differences? : Sql dba

540