You are on page 1of 1

12/1/2016 SQLInterviewQuestions

Express To Learn (Home/) Health Tips


(Health-Tips/)
Home (Home/) RDBMS (RDBMS/) SQL (SQL/) PL/SQL (PLSQL/)

Data Warehouse (Data-Warehouse-Introduction/) Informatica (Transformations/) ODI (ODI-Interview-Questions/)

UNIX (UNIX/) Contact Us (Contact-Us/) Blog (http://blog.baji.co.in/)


<<Previous Next>>
(SQL4/) (SQL41/)
Find out nth highest salary from EMP table?

SELECT DISTINCT a.sal from EMP a WHERE


&n=(SELECT count(DISTINCT(b.sal)) from emp b WHERE a.sal <= b.sal);

Display the records between two ranges?

SELECT rownum, empno, ename from emp where rowid in


( SELECT rowid from emp where rownum <=&upto minus SELECT rowid from emp where rownum
<&start).

Display Odd/even number of records?

ODD : SELECT * from emp where (rowid,1) in (SELECT rowid, mod(rownum,2) from emp);
EVEN: SELECT * from emp where (rowid,0) in (SELECT rowid, mod(rownum,2) from emp);

Which date function returns number value?

MONTHS_BETWEEN()

How many ways u can replace query result null value with a text?

2 ways.
Using NVL () function and SET NULL text;

How will you delete duplicate rows from a base table?

DELETE FROM <table_name> WHERE ROWID NOT IN (SELECT MAX (ROWID) FROM <table_name>
GROUP BY <column_name>);
Or
DELETE FROM <table_name> A WHERE ROWID > (SELECT MIN (ROWID) FROM <table_name> B WHERE
B.table_no= A.table_no);

<<Previous
Next>>
(SQL4/)
(SQL41/)
2016 baji.co.in Free
(http://api.hostinger.in/redir/159
(http://baji.co.in)
Sourceofthecontentisgatheredfrommultiplesourcesontheweb.Ownerisnotresponsibleforanyfalseorincorrectinformation,ifanycorrectionneededtothecontentreportitinthecontactus(ContactUs/)
pageorcontactadmin@baji.co.in

http://baji.co.in/SQL5/ 1/1