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.

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by a dispatcher?

553


My table got locked during mload due to a failed job. What do I do to perform other operations on it?

666


Why managing the data is important?

578


Differentiate primary key and partition key?

567


Discuss the advantages of using partitioned primary index in a query?

521






What is meant by a Clique?

573


What is meant by a node?

609


What are the available primary index types in teradata.

574


In a table can we use primary key in one column and in another column both unique and not null constrains.if yes how?

563


How does hashing happens in teradata?

608


What are the main components of teradata system?

572


What are the components provided on node?

559


If Fast Load Script fails and only the error tables are made available to you, then how will you restart?

624


Explain the term 'tables' related to relational database management system?

585


Write a program to show the parser component used in teradata?

541