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

Answer Posted / vikneswaran

SELECT deptno,SUM(sal) FROM emp
GROUP BY deptno

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

621


What are the types of join and explain each?

580


what are different types of keys in sql?

607


What is the difference between a primary key and a unique key?

558


how would you get the current date in mysql? : Sql dba

549






what are rollup and cube in t-sql? : Transact sql

661


Do foreign keys improve performance?

547


Is sql workbench free?

534


What is nosql example?

583


Which data dictionary views have the information on the triggers that are available in the database?

756


What is the difference between having clause and where clause?

572


ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..

2008


What is trigger and how to use it in sql?

540


What are secondary keys?

561


Why are aggregate functions called so?

516