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
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 |
Answer / kishore kumar
Select ename from emp where sal=(select max(sal) from emp)
| Is This Answer Correct ? | 13 Yes | 5 No |
Answer / jayabharathi
Select empname,salary from emp where salary=(select
max(salary) from emp)
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / reshu singhal
select name from employee where sal = (select max(sal) from
employee)
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / subrata sinha roy
SELECT NAME ,SAL FROM employee WHERE
SAL=(SELECT MAX(sal)from employee )
| Is This Answer Correct ? | 4 Yes | 2 No |
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 |
Answer / raju
SELECT NAME ,SAL FROM employee WHERE
SAL=(SELECT MAX(sal)from employee )
| Is This Answer Correct ? | 0 Yes | 0 No |
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?
What is temporary stored procedure?
Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?
What is the benefit of normalization?
How to find out what is the default collation in a database?
What happens if you are trying to access a schema not owned by you?
How are SQL Server databases physically stored under Windows 2000?
What is log shipping?
Explain the storage models of OLAP?
Tell me about builtinadministrator?
Which autogrowth database setting is good?
What language is sql server written in?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)