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


HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE.

Answers were Sorted based on User's Feedback



HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE...

Answer / kanhu charan biswal

select ename, sal from emp where sal=(select max(sal) from
emp);

For see the max(sal) with ename departmentwise the query
will be:
select ename,sal from emp a
where sal in (select max(sal) from emp group by deptno);

For findout the nth highest salary with name, the query
will be:

select ename,sal from emp a
where &n=(select count(distinct sal) from emp b
where b.sal>=a.sal)
after execute the query it will ask you to pass a value
for 'n'.it stands for nth hiest salary

Is This Answer Correct ?    0 Yes 0 No

HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE...

Answer / binod singh

SELECT max(Distinct sal),ename
FROM emp
/

SQL> select max(distinct salary) from employees;

MAX(DISTINCTSALARY)
-------------------
24000

Is This Answer Correct ?    3 Yes 5 No

HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE...

Answer / ahmad nazmi

select ename , max(sal)
from emp
group by ename;

Is This Answer Correct ?    1 Yes 3 No

HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE...

Answer / madhav

select ename from emp where sal=(select max(sal) from emp);
ENAME
---------
KING

--first execute the inner query like
select max(sal) from emp;
MAX(SAL)
---------
5000
--- after that salary value pass the outer query like
this
select ename from emp where sal=5000
ENAME
---------
KING

Email:thota.madhav@gmail.com

Is This Answer Correct ?    2 Yes 6 No

HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE...

Answer / suresh kumar somayajula

SELECT ename,MAX(sal)
FROM EMP
GROUP BY ename;

Is This Answer Correct ?    9 Yes 15 No

HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE...

Answer / ahmad nazmi

select ename , max(sal)
from emp
group by ename ;

Is This Answer Correct ?    4 Yes 11 No

Post New Answer

More SQL PLSQL Interview Questions

What are the different schemas objects that can be created using pl/sql?

0 Answers  


How does cross join work?

0 Answers  


how to create user in sql and how to set password for that?

3 Answers  


how to create a table index in mysql? : Sql dba

0 Answers  


what is difference between pass by value and eference by value in oracle plsql

1 Answers  


Explain normalization and what are the advantages of it?

0 Answers  


What is the order of sql select?

0 Answers  


what is the differnce between procedure and function? in both dml operations can work and in procedure through out parameter you can return value ,then what is the differce?

3 Answers   3i Infotech,


How do you delete data from a table?

0 Answers  


Which are the different case manipulation functions in sql?

0 Answers  


What are the different types of database management systems?

0 Answers  


What is before trigger?

0 Answers  


Categories