Anda di halaman 1dari 8

ORACLE PL/SQL

Interview Questions
You'll Most Likely Be Asked

Job Interview Questions Series

www.vibrantpublishers.com

*****

ORACLE PL/SQL Interview Questions You'll Most Likely Be Asked


Published by Vibrant Publishers at Smashwords
Copyright 2011 Vibrant Publishers, USA.
Smashwords Edition, License Notes

This ebook is licensed for your personal use only. This ebook may not be re-sold or given away to other people. If you
would like to share this book with another person, please purchase an additional copy for each recipient. If youre
reading this book and did not purchase it, or it was not purchased for your use only, then please return to
Smashwords.com and purchase your own copy. Thank you for respecting the hard work of this author.
This publication is designed to provide accurate and authoritative information in regard to the subject matter
covered. The author has made every effort in the preparation of this book to ensure the accuracy of the information.

However, information in this book is sold without warranty either expressed or implied. The Author or the Publisher
will not be liable for any damages caused or alleged to be caused either directly or indirectly by this book.

Vibrant Publishers books are available at special quantity discount for sales promotions, or for use in corporate
training programs. For more information please write to bulkorders@vibrantpublishers.com

Please email feedback / corrections (technical, grammatical or spelling) to spellerrors@vibrantpublishers.com

To access the complete catalogue of Vibrant Publishers, visit www.vibrantpublishers.com

*****

Table of Contents
1. General-Theory
2. DDL-DML
3. Exception Handling
4. Data Types
5. Execution Control Statements
6. Cursors
7. Procedures and Functions

8. Sequence Index
9. Joins
10. Packages and Triggers
11. Operators
12. HR Questions
INDEX

*****

ORACLE PL/SQL Questions


Review these typical interview questions and think about how you would answer them.
Read the answers listed; you will find best possible answers along strategy suggestions
with it.

*****

General-Theory
1: What is SQL?
Answer:
Structured Query Language (SQL) is a language that provides an interface to relational database systems.
In common usage SQL also encompasses DML (Data Manipulation Language), for INSERTs, UPDATEs,

DELETEs and DDL (Data Definition Language), used for creating and modifying tables and other
database structures.
2: What is database normalization?
Answer:
Normalization is the process of efficiently organizing data in a database. There are two goals of the
normalization process: eliminating redundant data (for example, storing the
same data in more than one table) and ensuring data dependencies make sense (only storing related data
in a table). Both of these are worthy goals as they reduce the amount
of space a database consumes and ensure that data is logically stored.

3: What do you understand by Deadlock situation?


Answer:
Deadlock is a situation in a multiuser system that causes two or more users to
wait indefinitely for Locked resources. First user needs a resource locked by the
second user and the second user needs a resource locked by the first user. To
avoid dead locks, avoid using exclusive table locks and if using, use it in the same
sequence and use commit frequently to release locks.
4: How can you generate debugging output from PL/SQL?
Answer:
Use the DBMS_OUTPUT package. Another possible method is to just use the SHOW ERROR command,
but this only shows errors. The DBMS_OUTPUT package can be used to show intermediate results from
loops and the status of variables as the procedure is executed. The new package UTL_FILE can
also be used.

5: What is a Dual?
Answer:

Dual is a Table that contains a single row. It has only one column which has
varchar2 data type and the value "X".
e.g.
SQL> describe dual;
SQL> Name Null? Type
DUMMY VARCHAR2(1)

SQL> select * from dual;

D
-X
6: What is a User Account in Oracle?
Answer:
A user account is identified by a user name and it defines the user's attributes
like,
a) Password for database authentication
b) Privileges & role
c) default tablespace for data objects

d) default temporary tablespace for query processing workspace.


7: What command is used to debug the errors?

Answer:

Unless your program is an anonymous block, your errors will not be reported.
Instead, SQL*Plus will display the message
"warning: procedure created with compilation errors''.

You will then need to type:


SQL> SHOW ERRORS
8: A table has the following data: [[5, Null, 10]].What will the average function
return?
Answer:
7.5
9: Is Sysdate a system variable or a system function?
Answer:
System Function
10: What is the result of the following SQL?
Select 1 from dual UNION Select 'A' from dual;
Answer:
Error

11: Are views automatically updated when base tables are updated?
Answer:
Yes

12: Can you alter synonym of view or view?


Answer:
No
13: What is the difference between a view and a synonym?
Answer:

Anda mungkin juga menyukai