ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Databases  >>  SQL PLSQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
consider a table which contain 4 columns,ename,eno,sal and 
deptno, from this table i want to know ename who having 
maximum salary in deptno 10 and 20.
 Question Submitted By :: Rajeshwari Bahaddur
I also faced this Question!!     Rank Answer Posted By  
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 1
select ename from table where sal=(select max(sal) from 
table) and depetno in (10,20)
 
Is This Answer Correct ?    13 Yes 11 No
Srilekha
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 2
Select ename from table where dept_no in ('10','20') group 
by dpt_no
 
Is This Answer Correct ?    0 Yes 12 No
Nancy
 
 
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 3
select empno  from emp where (sal,deptno) in ( select max
(sal),deptno from emp where deptno in (10,20) group by 
deptno)
 
Is This Answer Correct ?    8 Yes 3 No
Rohan
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 4
select ename from table where sal in
(select max(sal) from table_name
where deptno in ('10','20')
group by deptno);
 
Is This Answer Correct ?    6 Yes 5 No
Purushotham
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 5
select * from em where sal in (select max(sal) from em 
where dno in (10,20) group by dno) and dno in (10,20)

where em = table name
      dno = department number
      sal = salary
 
Is This Answer Correct ?    3 Yes 2 No
Kishore
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 6
select ename,sal from emp 
where sal in (select max(sal) from emp group by deptno) 
and deptno in (10,20)

Gautam
 
Is This Answer Correct ?    2 Yes 2 No
Gautam
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 7
Select emplid, sal from (select emplid, sal from 
emp_sal_tbl where deptid = 10 order by sal desc) a where 
rownum < 2
union
Select emplid, sal from (select emplid, sal from 
emp_sal_tbl where deptid = 20 order by sal desc) a where 
rownum < 2
 
Is This Answer Correct ?    0 Yes 1 No
Partha
 
  Re: consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
Answer
# 8
Select emp_name from emp where sal =(Select Max(sal) from 
emp where deptno=10) and deptno=10 union
Select emp_name from emp where sal =(Select Max(sal) from 
emp where deptno=20)and deptno=20
 
Is This Answer Correct ?    2 Yes 0 No
Guest
 

 
 
 
Other SQL PLSQL Interview Questions
 
  Question Asked @ Answers
 
what is julian date in oracle  1
Which clause of an UPDATE statement allows you to affect only certain rows of a table? 1. The WHERE clause 2. The SET clause 3. The ROWS AFFECTED clause 4. The ORDER BY clause HCL5
what are the advantages of primary key over unique+notnull Oracle5
how to get the third quarter of employee details from emp? CompuTech1
How to get the 3rd column(i.e all the data along with the column name)in a table? Logica-CMG1
write a query to delete similar records in same table TCS11
What is normalization ? BirlaSoft6
how do you count the duplicate records in a table Tech-Mahindra6
what is inline command?  2
what is the difernece between named and anonymous pl/sql blocks?? TCS8
what is difference between "Primary key" and "Unique key"? PreVator4
In testing where do we use sql language and how it helps in testing?  2
why sql is used as interpreter frequently rather than a compile?  1
how to saw triggers output in pl/sql database?  1
what is mean by forward declaration and where we'll use it. TCS4
What are the advantages of the packages Oracle5
What are two parts of package ? Infosys2
What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?  1
Can we use SQL%ISOPEN in implicit cursors? Does this attribute works properly in Implicit Curosors?  2
What are user defined stored procedures ? BirlaSoft3
 
For more SQL PLSQL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com