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                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 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
HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY
IN EMP TABLE
 Question Submitted By :: Durga Prasad
I also faced this Question!!     Rank Answer Posted By  
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 1
Select *from Emp_table where salary=20000

will display all the employees who have salary 20000
 
Is This Answer Correct ?    6 Yes 5 No
Raghuvir
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 2
SELECT * FROM  EMP WHERE (SAL = (SELECT sal
 FROM emp GROUP BY sal HAVING COUNT(sal) > 1))
 
Is This Answer Correct ?    6 Yes 5 No
Dilip
 
 
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 3
SELECT * FROM  EMP WHERE (SAL IN (SELECT sal
FROM emp GROUP BY sal HAVING COUNT(sal) > 1))
 
Is This Answer Correct ?    6 Yes 1 No
Sunil
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 4
sunil is correct...
 
Is This Answer Correct ?    3 Yes 1 No
Ravi
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 5
Select * From Employee 
Where Salary in 
 (Select Salary  From Employee Group by  Salary  Having    
           Count(Salary ) > 1)    

**Vinay Singh
**9867774724
 
Is This Answer Correct ?    11 Yes 0 No
Vinay Singh
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 6
Query Output is :

SQL> select *from emp where sal=any( select sal from emp 
group by sal having count(sal)>1);

     EMPNO ENAME      JOB              MGR HIREDATE         
SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- -------
--- ---------- ----------
      7521 WARD       SALESMAN        7698 22-FEB-81       
1250        500         30
      7654 MARTIN     SALESMAN        7698 28-SEP-81       
1250       1400         30
      7788 SCOTT      ANALYST         7566 19-APR-87       
3000                    20
      7902 FORD       ANALYST         7566 03-DEC-81       
3000                    20
 
Is This Answer Correct ?    5 Yes 0 No
Subbu
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 7
select *	
from emp
where (sal = (select sal from emp
group by sal 
having count(sal)>1))
 
Is This Answer Correct ?    2 Yes 1 No
Vijay
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 8
If there are two salaries are same in a single table then 
what we do??
example:-

id    salary
s1    1200
s2    1500
s3    1200 
s4    1500
s5    1800

now what query we used??
 
Is This Answer Correct ?    0 Yes 2 No
Sanjeev Aggarwal
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 9
plz reply me at

sanju.agg@gmail.com
 
Is This Answer Correct ?    0 Yes 0 No
Sanjeev Aggarwal
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 10
select * from emp1 where salary in (select salary from emp1 
group by salary having count(salary) >1)
 
Is This Answer Correct ?    2 Yes 0 No
Vidyalakshmi.s
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 11
select A.id,A.salary from employee  A inner join employee B
on A.salary = B.salary and A.id <> b.id
 
Is This Answer Correct ?    2 Yes 0 No
Aashish Mangal
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 12
select distinct A.id,A.salary from employee  A,employee B
where A.salary = B.salary and A.id <> b.id;
 
Is This Answer Correct ?    2 Yes 0 No
Antony
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 13
select * from emp where emp=(select sal from emp group by 
sal having count(sal)>1)
 
Is This Answer Correct ?    2 Yes 0 No
Gangi Naidu.k
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 14
SELECT TOP (3)with ties empsalry 
    FROM empsalr
        
order by empsalry desc;
 
Is This Answer Correct ?    1 Yes 2 No
Kumari
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 15
select e1.First_name,e1.salary from emp e1,emp e2 where 
e1.ROWID <> e2.ROWID and e1.salary=e2.salary;
 
Is This Answer Correct ?    1 Yes 0 No
Harish
 
  Re: HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
Answer
# 16
Vinay Singh, are apna naam kyun kharab kar rahe ho boss.
Sunil ki query ko modified kar ke reply karate ho.
 
Is This Answer Correct ?    0 Yes 0 No
Xyz
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
i need some interview questions on sql server developer plz any onee send some links.  1
How will u find the query which is running in some other machine IBM2
how to connect sybase to sql server 2005?. ABC1
explain different types of jions with examples briefly? Zensar1
If there exist a index on the table, and we then make a view on that table (include the indexed column from base table) than why do we require indexing on view?Doesnt it create an overhead?  1
What are the four main query statements?  3
Advantages and Disadvantages of Cursor? Zenith10
what is the Surrogate key?and wt is the diff between Primary key and Surrogate Key?  2
What is the difference between Userdefined function and stored procedure? Explain and give the example also  4
How do you find the error, how can you know the number of rows effected by last SQL statement?  1
Alternative way to DetDate() function?  4
what is hash table Teledata2
What is The Use Of TIMESTAMP DataType in SQL Server 2005?  3
hi, may i know what is the command to get abstract the current month, current year and current day from a given date.i want these three in a isolated way..seperatedly is that any way in sql server 2000  3
What is the difference between distinct clause and group by clause? Value-Labs1
What are mdf,ndf,ldf files and how to see the data in those files? Accenture5
create index a on employee(dno) In this,which index was created?  2
Rate yourself in .NET and SQL ? Cognizent1
why cluster and non clusterindex are used in sqlserver 2000? explain with example  1
What are statistics, under what circumstances they go out of date, how do you update them? HCL2
 
For more SQL Server 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