An employee table, with the columns id, name, sal and
dob.Query to select emp names of all highest salaries(there
are 4-5 people having the same salary which happens to be
the highest).

Answers were Sorted based on User's Feedback



An employee table, with the columns id, name, sal and dob.Query to select emp names of all highest ..

Answer / sujan thota

select name from emp where sal=(select max(sal) from emp)

Is This Answer Correct ?    6 Yes 0 No

An employee table, with the columns id, name, sal and dob.Query to select emp names of all highest ..

Answer / varun b n

select * from emp where sal = (select Max(sal) from emp)

Is This Answer Correct ?    6 Yes 2 No

An employee table, with the columns id, name, sal and dob.Query to select emp names of all highest ..

Answer / n. pavankumar

select * from emp where sal in (select max(sal) from emp)

Is This Answer Correct ?    2 Yes 2 No

An employee table, with the columns id, name, sal and dob.Query to select emp names of all highest ..

Answer / naveen kamatam

select ename, salary from emp e
where 4 > (select count(distinct salary)from emp where
Salary > e.salary)

it will fetch top 4 high salary records

Is This Answer Correct ?    1 Yes 2 No

An employee table, with the columns id, name, sal and dob.Query to select emp names of all highest ..

Answer / n@n!

emp table= emp;
column id =column_id;
name = name;
sal= sal;
dob= dob;


select top 1 name,sal,column_id,dob from emp order by sal
desc

while u run this query only one row was effected which
shows employee taken highest salary along with details like
column id,dob,name,sal.

if u want 5 employees list then replace top 1 by top 5



plz let me know if it was wrong (along with ur
query)...................

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More Manual Testing Interview Questions

what is agile testing

1 Answers  


Hi,Any body taking real time classes on manual testing.If u know please let me know in my E-Mail-id: anbarasu2k@gmail.com mob no:09740297798

4 Answers  


how to know whether the bug is valid or invalid?

6 Answers   GoldStone,


Why is it important to thoroughly retest a defect after it has been reported fixed? How will you do that?

3 Answers   ISB,


What is Traditional testing & Object Oriented testing?

0 Answers  






if you have 100 test cases, in that 80 passed and 20 failed, Which test cases your select for Retest and Regression testing?

4 Answers  


What is the Input of Testcase?

13 Answers   GE,


if u find a bug and reported to devoloper, but he is not agree with ur openion what u will do,how u convince to them

7 Answers   SunGard,


Difference between QA and Testing?

13 Answers   Deepak Enterprises, IBM, Mechanical, Trigent,


What is the base data for drawing Triangle?

6 Answers   DELL,


what is equivalence partition? what is the use of it?

5 Answers   Microsoft, Ready Test Go, Syntel,


what is the difference between test scenario n testcase.do we have separate template fr test scenario.what is the use of scenarios.pls explain with example.

4 Answers  


Categories