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

Explain the new features of teradata?

573


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

577


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

550


Differentiate database data and data warehouse data?

588


If the PMON is not working then how do you manage and monitor all processes, resources and sessions etc.

1671






What is the use of having index on table?

584


How to run a query in teradata?

587


What is the difference between teradata and oracle?

559


What is dimensional modeling?

595


What is teradata and why it is used?

591


Explain fallback in teradata?

610


What exactly do you know about catching in teradata?

641


Give a justifiable reason why Multi-load supports NUSI instead of USI.

682


What are the components provided on node?

580


How to Extract data from multiple legacy systems?

576