Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / kavithanedigunta

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

Is This Answer Correct ?    72 Yes 4 No

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

Answer / vikneswaran

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

Is This Answer Correct ?    12 Yes 2 No

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

Answer / rs

its right first one

Is This Answer Correct ?    9 Yes 3 No

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

Answer / abhishekjaiswal

select department_id,sum(salary) Dept_wise_salary,job_id from employees group by department_id,job_id
/
Output 
DEPARTMENT_ID DEPT_WISE_SALARY JOB_ID
------------- ---------------- ----------
          110             8300 AC_ACCOUNT
           90            34000 AD_VP
           50            55700 ST_CLERK
           80           243500 SA_REP
          110            12000 AC_MGR
           50            36400 ST_MAN
           80            61000 SA_MAN
           50            64300 SH_CLERK
           20            13000 MK_MAN
           90            24000 AD_PRES
           60            28800 IT_PROG




DEPARTMENT_ID DEPT_WISE_SALARY JOB_ID
------------- ---------------- ----------
          100            12000 FI_MGR
           30            13900 PU_CLERK
          100            39600 FI_ACCOUNT
           70            10000 PR_REP
                          7000 SA_REP
           10             4400 AD_ASST
           20             6000 MK_REP
           40             6500 HR_REP
           30            11000 PU_MAN

Is This Answer Correct ?    0 Yes 0 No

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

Answer / 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

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

Answer / radheshyam mali

Select sum(salary) from Employee group by deptno

Is This Answer Correct ?    6 Yes 10 No

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

Answer / lova raju allumalla

instead of deptno the result will give u in department name

select sum(sal),dname from emp e,dept d where
e.deptno=d.deptno group by dname
/

Is This Answer Correct ?    0 Yes 4 No

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

Answer / madhusudan darshannkar

SELECT COUNT(EID) AS EMPLOYEE,DEPTNON,SUM(SALARY) FROM
EMPLOYEE GROUP BY DEPTNO

Is This Answer Correct ?    4 Yes 12 No

Post New Answer

More SQL PLSQL Interview Questions

How packaged procedures and functions are called from the following?

2 Answers  


How do you create a unique index?

0 Answers  


How would you hide a table in sql. ie the table can be only visible to its maker?

3 Answers  


What is the source code of a program?

0 Answers  


what are the advantages of using stored procedures? : Sql dba

0 Answers  


What are %type and %rowtype for?

0 Answers  


Can a table contain multiple foreign key’s?

0 Answers  


How can you view the errors encountered in a trigger?

0 Answers  


What is the use of function in sql?

0 Answers  


how can we encrypt and decrypt a data present in a mysql table using mysql? : Sql dba

0 Answers  


How do you declare a variable in pl sql?

0 Answers  


What is pivot in sql?

0 Answers  


Categories