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
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 |
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 |
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 |
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 |
Answer / subbareddy kake
with out using any Join conditions
Select deptno, max(sal)
from emp group by deptno
| Is This Answer Correct ? | 3 Yes | 1 No |
List out teradata data types?
What is teradata and why it is used?
What is meant by a Virtual Disk?
How can we build data marts from FSLDM. is there any standard approach for this?Is FSLDM supports place ?
Write a program to show the parser component used in teradata?
What is spool space? Why do you get spool space errors?
Can we take collect stats on Dervied Tables and Volitable tables, What is Golabal Temporary table what is the use of this Golabal Temporary table ,When we create any kind table in Teradata it will show in Golabal Temporary table
what is differences between Fastload and Multiload as per DBA aspect ?
Aborted in Phase 2 data acquistion completed in fastload?
what are the uses of fact table and dimension table in banking project?
What is collect State in Teradata ? what it use and how it works??
write lock is compatiable with which type of lock?