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...


Write a query to get all details of employee who has maximum
salary from employee table

Answers were Sorted based on User's Feedback



Write a query to get all details of employee who has maximum salary from employee table..

Answer / krishh

SELECT max(salary) FROM Employee WHERE salary NOT IN (SELECT max(salary) FROM Employee);

Is This Answer Correct ?    23 Yes 4 No

Write a query to get all details of employee who has maximum salary from employee table..

Answer / vineet

Select * from EMP_TAB where salary = (select max(salary) from EMP_TAB;

Is This Answer Correct ?    8 Yes 1 No

Write a query to get all details of employee who has maximum salary from employee table..

Answer / vineetchauhan

select max(sal) from emp it will show max sal of

Is This Answer Correct ?    4 Yes 1 No

Write a query to get all details of employee who has maximum salary from employee table..

Answer / anil kumar prajapati

CREATE TABLE Employee_Test
(
Employee_ID INT,
Employee_name Varchar(100),
Employee_Salary Decimal (10,2)
);
INSERT INTO Employee_Test VALUES (1,'Anish',1000);
INSERT INTO Employee_Test VALUES (2,'Sushant',1200);
INSERT INTO Employee_Test VALUES (3,'Rakesh',1100);
INSERT INTO Employee_Test VALUES (4,'Manoj',1300);
INSERT INTO Employee_Test VALUES (5,'Amit',1400);
INSERT INTO Employee_Test VALUES (6,'Lokesh',1600);
INSERT INTO Employee_Test VALUES (7,'Maneneder',1400);
INSERT INTO Employee_Test VALUES (8,'Narendra',400);
INSERT INTO Employee_Test VALUES (9,'Kaushal',1900);
INSERT INTO Employee_Test VALUES (10,'Vikas',3400);
INSERT INTO Employee_Test VALUES (11,'Sudhir',800);
SELECT *FROM Employee_Test Emp1
WHERE ( n ) = (SELECT COUNT( DISTINCT (Emp2.Employee_Salary
) )
FROM Employee_Test Emp
WHERE Emp2.Employee_Salary >= Emp1.Employee_Salary
)

Is This Answer Correct ?    6 Yes 4 No

Write a query to get all details of employee who has maximum salary from employee table..

Answer / sureshramsing

select * from(select e.* from emp e order by sal desc) where rownum=1;

Is This Answer Correct ?    2 Yes 1 No

Write a query to get all details of employee who has maximum salary from employee table..

Answer / vj

with cte as
(
select row_number() over (order by employee_salary desc)
maxSal ,* from Employee_Test)
select * from cte where maxSal=1

Is This Answer Correct ?    1 Yes 1 No

Write a query to get all details of employee who has maximum salary from employee table..

Answer / mithilesh gatole

Answer -

SELECT FROM Employee Emp1 WHERE (N-1) = ( SELECT COUNT(DISTINCT(Emp2.Salary)) FROM Employee Emp2
WHERE Emp2.Salary > Emp1.Salary)

Is This Answer Correct ?    0 Yes 1 No

Write a query to get all details of employee who has maximum salary from employee table..

Answer / sureshramsing

select * from emp where (empno,1)=(select * from(select empno,row_number() over(order by sal desc) rn from emp) where rn=1);

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More SQL Server Interview Questions

Does transparent data encryption provide encryption when transmitting data across the network?

0 Answers  


What is a mixed extent?

0 Answers  


How can a database be repaired?

0 Answers  


What are user-defined functions (udfs) in sql server?

0 Answers  


Is sql server implemented as a service or an application? : Sql server database administration

0 Answers  


can a database be shrunk with users active? : Sql server administration

0 Answers  


What are pages and extents? : SQL Server Architecture

0 Answers  


What is statement level trigger?

0 Answers  


What are the advantages of using sql server over ms access or why should one use sql instead of ms access

2 Answers   CMS, Impetus,


Do you know what are acid properties of transaction?

0 Answers  


Explain the truncate command?

0 Answers  


What are Row versions of DataRow?

0 Answers  


Categories