we have two tables emp,dept.emp has eno,ename,sal and dept
has deptno,dname.how to find maxsal of each dept wise.which
join used for joining.

Answers were Sorted based on User's Feedback



we have two tables emp,dept.emp has eno,ename,sal and dept has deptno,dname.how to find maxsal of e..

Answer / priya

AS emp table doesnt have a field as deptno so we cant find
a maxsal of each dept wise, as no common field is used

Is This Answer Correct ?    12 Yes 0 No

we have two tables emp,dept.emp has eno,ename,sal and dept has deptno,dname.how to find maxsal of e..

Answer / ram reddy

Prerequisite
-------------
Both emp and dept tables should have deptno column

select depno,max(sal)
from emp e,dept d
where e.deptno=d.deptno
group by deptno;

Is This Answer Correct ?    14 Yes 5 No

we have two tables emp,dept.emp has eno,ename,sal and dept has deptno,dname.how to find maxsal of e..

Answer / yuvaevergreen

Since there is no common column, it may not be possible to
join two tables.
if deptno is in emp table, correlated query can be used
emp
eno ename sal deptno
1 yuva 10 tn1
2 yuv1 20 tn2
3 yuv3 30 tn1


select * from emp as e1
where sal in
(sel max(sal) from emp as e2
where e1.deptno=e2.deptno);

Is This Answer Correct ?    10 Yes 1 No

we have two tables emp,dept.emp has eno,ename,sal and dept has deptno,dname.how to find maxsal of e..

Answer / kondeti srinivas

emp table having depnto and dept table contains deptno
then only we can join the two table and find out max sal
dept wise
query:
select e.deptno,d.dname,max(e.sal) from emp e,dept d
where d.deptno=e.deptno
group by e.deptno,d.dname

Is This Answer Correct ?    5 Yes 1 No

we have two tables emp,dept.emp has eno,ename,sal and dept has deptno,dname.how to find maxsal of e..

Answer / subbareddy kake

with out using any Join conditions

Select deptno, max(sal)
from emp group by deptno

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Teradata Interview Questions

what is the advantages of other etl tool than teradata utilities or vice versa ?(datastage/informatica)

4 Answers  


How can bottlenecks be identified?

0 Answers  


How do you create a table with an existing structure of another table with data and with no data?

1 Answers  


What are default access rights in teradata? What explicit right can be given to a user?

0 Answers  


1.what is activity count? 2.what is skew factor? how it's working explain brefily

5 Answers   Satyam,






what is amp plz explanation

5 Answers   IBM,


how do we write scripts in unix how to execute scripts in real time anybody please needfull or give me number i will cal u

0 Answers  


How to find duplicates in a table?

0 Answers  


Hi frinds pls help me regarding this question WHY usi is two amp operation in teradata? THANKS IN ADVANCE....

3 Answers  


If I wanted to run a TPump job only once per day - basically working on a file that is produced once per day - how would you set up the parameters for that sort of job ?

0 Answers  


What is the maximum number of dml can be coded in a multiload script?

0 Answers  


How to eliminate product joins in a teradata sql query?

0 Answers  


Categories