- World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.

Get it now !!
Send your Resume to 6000 Companies
SQL Plus Interview Questions & Answers - Learning Mode

SQL Plus Interview Questions & Answers - Learning Mode

SQL*Plus is an interactive and batch query tool that is installed with every Oracle Database Server or Client installation. It has a command-line user interface, a Windows Graphical User Interface (GUI) and the iSQL*Plus web-based user interface. SQL*Plus is essentially an interactive query tool with some scripting capabilities. You can enter a SQL statement, such as a SELECT query, and view the results.

Try SQL Plus Interview Questions & Answers - Exam Mode

1 2 3 4 5 6 Next

Sort By : Latest First | Oldest First | By Rating

SQL Plus Interview Questions & Answers - Learning Mode
Try SQL Plus Interview Questions & Answers - Exam Mode
Question: How to get/select the nth row from the table ?
How to select first n rows ,last n rows from a table

Answer: nth salary

select salary

from table_name a

where &n=(select count(salary) from table_name b where a.salary<=b.salary);

n salaries

select salary

from table_name a

where &n>=(select count(salary) from table_name b where a.salary<=b.salary);
Question: What is meant by Scrollable cursor

Answer: A scrollable cursor, however, can move forward and backward, and can seek any desired record in the cursor. Such operations are common in applications that present results sets in scrolling windows. With a scrollable cursor, application developers do not need to create and manage their own buffer for the records. Source:
Question: Subquery vs Join

Answer: subquery retrive the data depending on certain condition or manupulation in inner query.

where as joins will join the enitire data depending on the conditions given it cannot manupulate the data or we cannot be selective while using joins

Question: Find out nth highest salary from emp table

Answer: select sal from emp E
wherenulln-1=(select count( distinct sal) from emp where
sal>E.sal); Source:
Question: Display the records between two range I know the nvl function only allows the same data type(ie. number or char or date Nvl(comm, 0)), if commission is null then the text ?Not Applicable? want to display, instead of blank space. How do I write the query

Answer: You can use the decode function for the above requirement. Please find the query as below:

select ename,decode(nvl(comm,0),0,'Not Applicable',comm) from scott.emp;

Question: Explain CONNECT BY PRIOR

Answer: Retrieves rows in hierarchical order.e.g. select empno, ename from emp where.
Question: What is the maximum number of triggers, can apply to a single table

Answer: Insert/Update/Delete :- 3
Before/After:- 2
Row Level/Statement Level:-2

Hence 3*2*2 Source:
Question: What is difference between CHAR and VARCHAR2?

Answer: CHAR pads blank spaces to the maximum length. VARCHAR2 does not pad blank spaces. For CHAR it is 255 and 2000 for VARCHAR2. Source:
Question: Can a view be updated/inserted/deleted? If Yes under what conditions ?

Answer: A View can be updated/deleted/inserted if it has only one base table if the view is based on columns from one or more tables then insert, update and delete is not possible. Source:
Question: If an unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE ?

Answer: It won't, Because SYSDATE format contains time attached with it. Source:
Question: What are PL/SQL Cursor Exceptions

Answer: Cursor_already_open, Invalid_cursor

Question: Explain the different types of joins

Answer: Join is a query which retrieves related columns or rows from multiple tables.Self Join - Joining the table with itself.Equi Join - Joining two tables by equating two common columns.Non-Equi Join - Joining two tables by equating two common columns.Outer Join - Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table. Source:
Question: What are the pre-requisites to modify datatype of a column and to add a column with NOT NULL constraint

Answer: 1) to modify datatype of a column - ???
2) to add a column with NOT NULL constraint - the table must have 0 rows Source:
Question: What are the usage of SAVEPOINTS ?

Answer: SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables rolling back part of a transaction. Maximum of five save points are allowed. Source:

Answer: INTERSECT returns all distinct rows selected by both queries.MINUS - returns all distinct rows selected by the first query but not by the second.UNION - returns all distinct rows selected by either queryUNION ALL - returns all rows selected by either query, including all duplicates. Source:
Question: How do I eliminate the duplicate rows?

Answer: Use the DISTINCT keyword right after SELECT...

i.e. SELECT DISTINCT customername FROM customer Source:
Question: How many LONG columns are allowed in a table ? Is it possible to use LONG columns in WHERE clause or ORDER BY ?

Answer: Only one LONG columns is allowed. It is not possible to use LONG column in WHERE or ORDER BY clause. Source:
Question: How can you call a PL/SQL procedure from SQL?

Answer: By use of the EXECUTE (short form EXEC) command. Source:
Question: What is a Non- corelated subquery

Answer: Non corelated subquery, where the subquery has been executed once for the entire parent statement. Source:
Question: You want to determine the location of identical rows in a table before attempting to place a unique index on the table, how can this be done?

Answer: Oracle tables always have one guaranteed unique column, the rowid column. If you use a min/max function against your rowid and then select against the proposed primary key you can squeeze out the rowids of the duplicate rows pretty quick. For example:
select rowid from emp e
where e.rowid > (select min(x.rowid)
from emp x
where x.emp_no = e.emp_no);
In the situation where multiple columns make up the proposed key, they must all be used in the where clause. Source:

1 2 3 4 5 6 Next

India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.03125 Seconds