Home > Software > Data-Warehouse > Informatica
Interview Questions   Tutorials   Discussions   Programs

# Informatica - it should be done through yhe mapping only find out the employees which having the sal >= avg(sal) of that particular dept

411
views
asked suresh-362 April 25, 2014 10:57 PM

it should be done through yhe mapping only find out the employees which having the sal >= avg(sal) of that particular dept

we can find it using correlated sub-query, -- the salaries of employees greater than avg(salary) of each deptartment

SELECT E.ENAME, E.JOB, E.DEPTNO, E.SAL FROM DIM_EMP E WHERE
e.sal > (select avg(b.sal) from dim_emp b where b.deptno=e.deptno) order by e.deptno;
flag

we can find the salaries of employees greater than avg(salary) of each deptartment using correlated sub-query

SELECT E.ENAME, E.JOB, E.DEPTNO, E.SAL FROM DIM_EMP E WHERE
e.sal > (select avg(b.sal) from dim_emp b where b.deptno=e.deptno) order by e.deptno;
flag

flag

flag

use below query in  SQ and then connect expression to Target

select a.ename,a.eno,b.esal,b.deptno from emp A,select avg(esal) esal,deptno from emp group by deptno) b
where A.sal >=B.sal and A.deptno = B.deptno
flag

use below query in  SQ and then connect expression to Target

select a.ename,a.eno,b.esal,b.deptno from emp A,select avg(esal) esal,deptno from emp group by deptno) b
where A.sal >=B.sal and A.deptno = B.deptno
flag

### Join with account you already have

Preview

Online-Classroom Classes
www.writeabc.com

1 person following this question

2 people following this tag

Question tags

informatica × 1

Asked 4 years and 11 months ago ago
Number of Views -411