Scenario is like this:
Name Sal
A 10;
B 20;
C 30;

Then Output should be
Name Sal
A 10;
B 20;
C 30;
Total 60;

Use SQL For this scenario

Answers were Sorted based on User's Feedback



Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

Answer / niru

select name,salary from emp
union
select "total",sum(sal) from emp

Is This Answer Correct ?    11 Yes 4 No

Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

Answer / kiran

SQL> select ename,sal from emp union select 'total:',sum(sal) from emp;

Is This Answer Correct ?    7 Yes 0 No

Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

Answer / situ

first create a table emp4 using the above data then execute the below query to find that output
select case when grouping(name)=1 then 'Total'else name end as name,sum(sal) as sal from emp4 group by rollup(name);

Is This Answer Correct ?    1 Yes 0 No

Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

Answer / pooja

Select case when GROUPING(e.Name)= 1
then'Total'else e.Name end as Name,
sum(e.Salary)as Salary from Emp e
group by e.Name with rollup

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Informatica Interview Questions

Plz can anybody send Informatica and Cognos FAQ Plz To thid ID ppradeep_dwh@ayhoo.co.in

2 Answers  


Hi, I am new to Informatica, What is a flat file and how to use flat file in infomratica please help me.

10 Answers   CSC,


In any project how many mappings they will use(minimum)?

1 Answers  


According to his methodology what all you need before you build a datawarehouse

1 Answers  


When will u go for Dynamic Cache and Persistent Cache? Pls explain with an example?

2 Answers   TCS,


how to load first record of first time run,second record to 2nd time n 3rd record from 3rd time to target table

2 Answers  


WHat all joins are there in Source Qualifier?

1 Answers  


What is confirmed dimension and fact?

7 Answers  


How do we come to know the Source data/file is ready/Updated in the source location, when the session is scheduled for @12:00AM and ready to run its job ? or Can we schedule the session, when the source is updated in source location without any time constraint?

2 Answers   iFlex, TCS,


My source is this year 01/jun/2014 04/may/2015 09/mar/2017 my desired output is day month ye 01 jun 2014 04 may 2015 09 mar 2017 how do i acheive this

2 Answers  


what is meant by data driven.. in which scenario we use that..?

2 Answers   IBM,


How can you recognise whether or not the newly added rows in the source r gets insert in the target ?

2 Answers  


Categories