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

Answer Posted / kavithanedigunta

select deptno,sum(sal) from employee
group by deptno;

Is This Answer Correct ?    72 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use procedures in sql?

556


what is the syntax for using sql_variant_property? : Transact sql

538


Can a key be both primary and foreign?

515


What is the best partition size for windows 10?

496


What is data definition language?

628






What is the purpose of cursors in pl/sql?

645


How to create a menu in sqlplus or pl/sql?

618


How many postgresql users are there, worldwide?

586


Explain two easy sql optimizations.

606


Explain the types of joins in sql?

579


Can we commit in trigger?

551


What is the advantage of index in sql?

543


What is the use of nvl function?

626


Write an sql query to select all records from the table?

563


How to check if a column is nullable before setting to nullable?

589