Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 / amol dhane

Select * From (Select emp1.*, dense_rank () Over (Order By
sal asc) Salary_Order From employee emp1)emp2 Where
Salary_Order = 1

Is This Answer Correct ?    10 Yes 1 No

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

Answer / kishore kumar

Select ename from emp where sal=(select max(sal) from emp)

Is This Answer Correct ?    13 Yes 5 No

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

Answer / jayabharathi

Select empname,salary from emp where salary=(select
max(salary) 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 / reshu singhal

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

Is This Answer Correct ?    4 Yes 1 No

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

Answer / subrata sinha roy

SELECT NAME ,SAL FROM employee WHERE
SAL=(SELECT MAX(sal)from employee )

Is This Answer Correct ?    4 Yes 2 No

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

Answer / anil

select name,sal from employee where sal in(select top 5 sal from employee order by sal desc)

Is This Answer Correct ?    7 Yes 7 No

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

Answer / raju

SELECT NAME ,SAL FROM employee WHERE
SAL=(SELECT MAX(sal)from employee )

Is This Answer Correct ?    0 Yes 0 No

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

Answer / swathi

I have just mentioned that 4-5....but ingeneral when you
donno how many employees are there with highly paid
amount...then how are you going to write the query

Is This Answer Correct ?    0 Yes 2 No

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

Answer / kalyan

select name,max(sal) from emp group by name

Is This Answer Correct ?    6 Yes 8 No

Post New Answer

More SQL Server Interview Questions

What is the Difference Between Primary and Foreign Key?

0 Answers   Accenture, Deloitte, JPMorgan Chase, Maveric,


SQL Server Architecture ?

0 Answers   IBM, Sapient,


WHICH IS THE BEST INSTITUTE IN HYD FOR "ORACLE"?

3 Answers  


How To Find That One Week Change in My DataBase we Have Done Like We Have A database Test I Change Table,Stored Procd. Then I Find Which SP,Table We Have Edit/Change in Seven Dayes

1 Answers   INDUS,


How to transfer an existing table from one schema to another schema in ms sql server?

0 Answers  


How to drop an existing schema in ms sql server?

0 Answers  


In which year relase the 7.0& 2000 & 2005?

1 Answers  


What are the advantages of using cte?

0 Answers  


Can anyone explain difference between Database, Data warehouse and Data mart with some example?````

4 Answers  


hi to all teachers,... Friends who write in the query mode Full text Search in Sql Server have experience Who make(Convert) this Stored Procedure as a normal Full text Search, which contains and .. Is used, into Advance of the tips I have thanked all friends perfection. Email : rezaafandi@yahoo.com Create PROCEDURE Sp_student @fname varchar(50), @lname varchar(50), @tel varchar(50), @code varchar(50), @adr varchar(50), @search_operation varchar(50), @totalRowCount bigint output AS begin if @search_operation = 'and' begin SELECT f3,f4,f5,f6,f7 FROM tb_student WHERE( f5 like '%' + @fname + '%' and f4 like '%' + @lname + '%' and f6 like '%' + @tel + '%' and f7 like '%' + @code + '%' and f3 like '%' + @adr +'%' ) select @totalRowCount = @@rowcount end

0 Answers  


How do I repair damaged sql server mdf file database? In previous day my mdf file has got damage due to unknown reasons then I used dbcc chekcdb command but it failed, MDF file is important for me, I don’ know that how to get back mdf file data. Please anyone suggest me?

0 Answers  


Creating Tables Using SELECT

1 Answers  


Categories