write a query to select name from one table which has
id,name and salary from another table which has id, sal
where the salary is the second maximum

Answer Posted / bln

Select emp.name, emp.id, sal.salary from empDetai emp,
empSal sal
where emp.id=
(select innnerEmp.id from
(select innerEmpSal.id, innerEmpSal.sal from empSal
order innerEmpSal.salary desc

) where rowid=2;

)
And emp.id=sal.id;

This queiry initially execute the inner query and sort
records based on the salary. second inner query returns the
id of second maximum salary.

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is resultsetmetadata?

503


How can we store the file in the oracle database?

520


Can I set up a connection pool with multiple user IDs? The single ID we are forced to use causes problems when debugging the DBMS.

520


If you are given a choice to implement the code to either insert a record or update if already exist, which approach will you follow ?

578


What is the most common example type 1 driver?

594






What is an encrypted internet connection?

499


How we store procedure in oralce for callable statements in jdbc

1850


Are all the required JDBC drivers to establish connectivity to my database part of the JDK?

528


How many ways can you update a result set?

559


What is resultset?

568


How can you create jdbc statements?

530


Explain the necessary steps to connect to the database in java?

550


Which type of driver is unique in jdbc?

488


Explain jdbc savepoint?

564


What are clob and blob data types in jdbc?

563