From an Employee table, how will you display the record
which has a maximum salary?
Answers were Sorted based on User's Feedback
Answer / debjani chakraborty
Select * from Employee where salary in(select max(salary)
from Employee);
| Is This Answer Correct ? | 58 Yes | 2 No |
Answer / kavitha nedigunta
select * from emp e,(select max(sal) sal
from emp)a
where e.sal= a.sal;
select * from emp
where sal in(select max(sal) from
emp);
| Is This Answer Correct ? | 29 Yes | 3 No |
Answer / pradeep sahoo
Select * from Employee where sal = (select max(sal) frpm
Employee)
| Is This Answer Correct ? | 25 Yes | 1 No |
Answer / sharmila
Select * from Employee where salary in(select max(salary)
from Employee)
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / aruna parulekar
select * from employee where sal=(select max(sal) from
employee);
| Is This Answer Correct ? | 14 Yes | 2 No |
Answer / kvsd
select * from employees where salary = (select max(salary)
from employees)
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / os reddy
select * from emp
where sal=(select max(sal) from emp);
OR
select * from emp
where sal in(select max(sal) from emp);
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / pradeep
To get nth rank salary or max salary two ways
below 5th
select ct , empno, sal from (SELECT max(rownum) ct , empno,
sal FROM emp group by empno, sal ORDER BY sal desc) where
ct =5;
below 2nd
select * from (
SELECT DEPTNO,ENAME,SAL,COMM,
RANK() OVER ( ORDER BY SAL DESC, COMM) poK from emp)
where pok =2;
| Is This Answer Correct ? | 3 Yes | 1 No |
a. Can you delete data from a View. b. If Yes, can you delete it if there are multiple tables c. If No, can you delete if there is single source table which is joining.
What is a primary key sql?
Explian rowid, rownum? What are the psoducolumns we have?
Difference between views and materialized views?
Which sql statement is used to return only different values?
What are the different schemas objects that can be created using pl/sql?
how do you tune the slow running queries in oracle db , explain the methodology
What is set serveroutput on?
trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output trans_id trans_date trans_amt debit_credit_indicator 001 JAN 1599 cr no.of trans 2 i want trans_id and trans_date like 'JAN' or 'FEB' etc, trans_amt i want all credit amount - debit amount per each trans_id. and debit_credit_indicator and no.of transactions in a month.
What is Overloading of procedures ?
What are the ways on commenting in a pl/sql code?
What is not null in sql?
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)