Interview QA
Interview QA
Interview QA
with answers and; other useful job interview materials such as: •
1 of 10
to the recruitment position, you must know how to answer. You need
to know about the company you are willing to work for and read their
job description. When you are asked this question, tell them that
the job and like other employees in the company; or • The job is quite
the company with the best training & development policy. This is
Corporation is the number one in ABC industry which I have long been
studying and aiming for. I hope with my ability and the opportunity to
on the organization before the interview. Find out where they have
been and where they are going. What are the current issues and who
company then its better to go through the company website and know
Organization has all the qualities like good growth, good Environment,
4. This question will test your ability and ambition to develop yourself
as well as the ability to plan for the future. 2. Levels of career goals: •
You are not sure about your goals, then answer: I’m rather busy with
little relating to the current job: For example, you are applying for a
career goals: For example, you are working as a sales manager, you
goal is to become the area sales manager in the next 2 years and in
the next 5 years, you will be the regional sales manager. Useful
http://interviewquestionsaz.blogspot.com/2013/07/list-of-37-career-
your strong points in your resume and cover letter orderly. You should
points: You do not only state your strong points to the employer but
strengths samples
http://interviewquestionsaz.blogspot.com/2013/07/20-job-strengths-
work for Oracle Corporation if hired? Some tips for this question: • It
is not right to be specific; else you are giving them the impression
that you are not going to stay if hired. • Specifics here are not good.
Something like this should work: I’d like it to be a long time. Or As
long as we both feel I’m doing a good job. Sample answers Interview
loyalty. So, as long as the work is challenging, and I will have growth
and training potential, I will be happy to work here. • First of all I pity
you for hiring me, I will rob you blind, eat all the almonds and pee in
the punch bowl any chance I get. So the answer to your question is,
until you catch on. Question 6: Do you know anyone who works for
working for the organization. This can affect your answer even though
only if they have good records in the company. Other interview tips •
how to get them. • Review job specs, job description in job ads for
answers Page 6 of 10
7. Question 7: Why should Oracle Corporation hire you? For one, the
make a short list of all your advantages and create a paragraph that
would point out the positive aspects that you would bring to the new
job position. 2. One of the points that you can raise is the similarity of
the job profile you are aiming for at the company to the job profile you
enjoyed in your previous job. 3. You can also draw the interviewer’s
you have for the profession and the opening position. II. Answer
know what you can do for “them.” Interview questions and answers
Page 7 of 10
http://interviewquestionsaz.blogspot.com/2013/07/top-10-secrets-to-win-
http://interviewquestionsaz.blogspot.com/p/13-types-of-interview-
http://interviewquestionsaz.blogspot.com/2013/07/top-12-common-
http://interviewquestionsaz.blogspot.com/2013/07/job-interview-
http://interviewquestionsaz.blogspot.com/2013/07/top-3-interview-thank-
10. Other job interview tips for Oracle Corporation: 1. Practice types
http://interviewquestionsaz.blogspot.com/2013/07/top-10-questions-to-
ask- employer-duting.html Interview questions and answers Page 10
of 10
The questions range from Basic to Advanced. I gave a concise answer too, only for quick reference and
revision. For detailed answer to each question, refer to any Oracle PL/SQL online documentation.
Some of these questions were actually asked in my Job Interviews in the US.
I have added some others which I found interesting. Very useful to know.
- Name or handle to a private SQL area where Oracle parses and fetches query results.
-Oracle recognizes similar statements. The SQL area is used many times for similar statements.
What is the difference between anonymous blocks and stored procedures ? ( Basic)
- Stored procedure is compiled and stored in database with the dependency information as well.
- Former is PL/SQL code directly called from an application. Latter is stored in database.
- Performance better coz all SQL stmts are sent in one go from the application to the database
- Prior to Oracle 9i, we have only bytecode and a virtual machine in the database runs it. Later versions
have faster native code execution.
- PL/SQL engine is the main component that executes procedural stmt and passes the SQL to the SQL
statement executor.
- It has all the advantages of dynamic sql .. like runtime construction of sql, DDL statements can be
executed.
What is a package spec and package body ? Why the separation ? ( Basic)
- Spec declares public constructs. Body defines public constructs, additionally declares and defines Private
constructs
- Dependency is simplified. You can modify body without invalidating dependent objects.
- Dependency simplified
- Use the SAVE EXCEPTIONS clause ( FORALL index IN bound_clause SAVE EXCEPTIONS LOOP ...
END LOOP )
- SQL%BULK_EXCEPTIONS(i).ERROR_CODE,
SQL%BULK_EXCEPTIONS(i).ERROR_INDEX
SQL%BULK_EXCEPTIONS.COUNT
- Use FORALL instead of FOR, and use BULK COLLECT to avoid looping many times
- Use NOCOPY for OUT and IN OUT if the original value need not be retained. Overhead of keeping a copy
of OUT is avoided.
- Minimize datatype conversions => Assign data to exact same type variables
- Use PLS_INTEGER for computation intensive code. NUMBER, INTEGER maintain precision and scale
but not optimized for performance as additional checks are made to maintain precision and scale.
- Do not use subtypes like POSITIVE, NATURAL, INTEGER as they have additional checks
- ALL_PLSQL_OBJECT_SETTINGS
- Conditional compilation
- Quoting mechanism . Instead of quoting single quotes twice everytime, give your own delimiter to go on
using single quotes.
- Improved Overloading
Q.What is SQL*Loader?
SQL*Loader is a product for moving data in external files into tables in an Oracle
database. To load data from external files into an Oracle database, two types of input
must be provided to SQL*Loader : the data itself and the control file. The control file
describes the data to be loaded. It describes the Names and format of the data files,
Specifications for loading data and the Data to be loaded (optional). Invoking the loader
sqlload username/password controlfilename <options>.
the above person have answerd wrong. Or rather the question may be wrong. It should
be packages instead of procedures. What are the 2 parts of package ? But the question is
what are the 2 parts for procedue!!!
Procedure Specification and Procedure Body.
Q.What is NVL?
NVL: Null value function converts a null value to a non-null value for the purpose of
evaluating an expression. Numeric Functions accept numeric I/P & return numeric values.
They are MOD, SQRT, ROUND, TRUNC & POWER.
Q.What is Intersect?
Intersect is the product of two tables listing only the matching rows.
Q.What is Minus?
Minus is the product of two tables listing only the non-matching rows.
Q.What is Consistency?
consistency: states that until commit the data will not be reflected to other users,in order
to maintain proper consistency.
consider a example: if user A transfer money to user B. The changes are updates in A
account (debit) but until it will be updated in B (credit) too till then others will not be able
to see the debit of A. when debit to A and credit to B happen then one can see the
updates hence maintain consistency
Q.What are % TYPE and % ROWTYPE? What are the advantages of using these
over data types?
% TYPE provides the data type of a variable or a database column to that variable.
% ROWTYPE provides the record type that represents a entire row of a table or view or
columns selected in the cursor.
The advantages are : I. Need not know about variable's data type
ii. If the database definition of a column in a table changes, the data type of a variable
changes accordingly.
Q.What will the Output for this Coding
Declare
Cursor c1 is select * from emp FORUPDATE;
Z c1%rowtype;
Begin
Open C1;
Fetch c1 into Z;
Commit;
Fetch c1 in to Z;
end;
By declaring this cursor we can update the table emp through z,means wo not need to
write table name for updation,it may be only by "z".
By issuing the TCL like commit or rollback, the cursor will be closed automatically, you
cannat fetch again. You will get an error if you
Q.What is Commit?
Commit is an event that attempts to make data in the database identical to the data in
the form. It involves writing or posting data to the database and committing data to the
database. Forms check the validity of the data in fields and records during a commit.
Validity check are uniqueness, consistency and db restrictions.
Q.If the application is running very slow? At what points you need to go about
the database in order to improve the performance?
For improving performance, we need to check the sql statement blocks , because for
every sql satement execution transfor to sql engine and come back to plsq engine that
process takes more time to process the plsql block.
Q.How to avoid using cursors? What to use instead of cursor and in what cases
to do so?
just use subquery in for clause
ex:
for emprec in (select * from emp)
loop
dbms_output.put_line(emprec.empno);
end loop;
no exit statement needed
implicit open,fetch,close occurs
Q.How many types of database triggers can be specified on a table ? What are
they ?
Insert Update Delete
Before Row o.k. o.k. o.k.
After Row o.k. o.k. o.k.
Before Statement o.k. o.k. o.k.
After Statement o.k. o.k. o.k.
If FOR EACH ROW clause is specified, then the trigger for each Row affected by the
statement.
If WHEN clause is specified, the trigger fires according to the returned Boolean value.
Q.Explain how procedures and functions are called in a PL/SQL block ?
Function can be called from SQL query + explicitly as well
e.g 1)select empno,salary,fn_comm(salary)from employee;
2)commision=fn_comm(salary);
Procedure can be called from begin-end clause.
e.g.
Begin
(
proc_comm(salary);
)
end
Function is called as part of an expression.
sal := calculate_sal ('a822');
procedure is called as a PL/SQL statement
calculate_bonus ('A822');
Q.Can we declare a column having number data type and its scale is larger than
pricesion
ex: column_name NUMBER(10,100),
column_name NUMBAER(10,-84)
Yes,
we can declare a column with above condition.
table created successfully.
Q.The IN operator may be used if you know the exact value you want to return
for at least one of the columns.
SELECT column_name FROM table_name WHERE column_name IN (value1,value2,..)
Q.What is Sequences?
Sequences are used for generating sequence numbers without any overhead of locking.
Drawback is that after generating a sequence number if the transaction is rolled back,
then that sequence number is lost
Q.What are % TYPE and % ROWTYPE ? What are the advantages of using these
over datatypes?
% TYPE provides the data type of a variable or a database column to that variable.
% ROWTYPE provides the record type that represents a entire row of a table or view or
columns selected in the cursor.
The advantages are : I. Need not know about variable's data type
ii. If the database definition of a column in a table changes, the data type of a variable
changes accordingly.
Q.How many types of database triggers can be specified on a table? What are
they?
Insert Update Delete
Before Row o.k. o.k. o.k.
After Row o.k. o.k. o.k.
Before Statement o.k. o.k. o.k.
After Statement o.k. o.k. o.k.
If FOR EACH ROW clause is specified, then the trigger for each Row affected by the
statement.
If WHEN clause is specified, the trigger fires according to the returned Boolean value.
Q.How can a function retun more than one value in oracle with proper example?
Basically as per property of function it has to return one value. So the other values can
be returned from the out parameter of the function.
But its advised if you want more that one return value go for procedure however function
will also yield the same result.
Q.Explain If the entire disk is corrupted how will you and what are the steps to
recover the database?
if the entire disk is corrupted and no backup is there don nothing sit and relax their is no
possibility of recovery ...a backup is required for restoration and for recovery redo log
and archive logs.
Once if you have theses than think of recovering ..a dba should always plan for the
recovery scenario depending upon the criticality of the database.oracle provides 0% data
loss facilty through data guard and online backup .its dba who has to decide.
Q.What is Rollback?
Rollback causes work in the current transaction to be undone.
Q.How we can create a table in PL/SQL block. insert records into it? is it
possible by some procedure or function? please give example?
CREATE OR REPLACE PROCEDURE ddl_create_proc (p_table_name IN VARCHAR2)
AS
l_stmt VARCHAR2(200);
BEGIN
DBMS_OUTPUT.put_line('STARTING ');
l_stmt := 'create table '|| p_table_name || ' as (select * from emp )';
execute IMMEDIATE l_stmt;
DBMS_OUTPUT.put_line('end ');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('exception '||SQLERRM || 'message'||sqlcode);
END;
Q.What is a JOIN?
JOIN is the form of SELECT command that combines info from two or more tables.
Types of Joins are Simple (Equijoin & Non-Equijoin), Outer & Self join.
Equijoin returns rows from two or more tables joined together based upon a equality
condition in the WHERE clause.
Non-Equijoin returns rows from two or more tables based upon a relationship other than
the equality condition in the WHERE clause.
Outer Join combines two or more tables returning those rows from one table that have no
direct match in the other table.
Self Join joins a table to itself as though it were two separate tables.
Q.Can we declare a column having number data type and its scale is larger than
pricesion
ex: column_name NUMBER(10,100),
column_name NUMBAER(10,-84)
No, you cant. May be your table might be created successfully but if you try to insert
values it will shows you an error.
Numeric or Value Error
NUMBER (p,s)
p- precision, which is the total size of digits
s- scale , which represents the total number of digits that are present to the right side of
the decimal.
s should be strictly less than p. If I am missing somthing. Please fill me in.
Yes,we can declare a column with above condition.table created successfully.
yes, 100 is the total size and 10 is included in 100
Q.What is Posting?
Posting is an event that writes Inserts, Updates & Deletes in the forms to the database
but not committing these transactions to the database.
Q.How to avoid using cursors? What to use instead of cursor and in what cases
to do so?
Just use subquery in for clause
ex:For emprec in (select * from emp)
loop
dbms_output.put_line(emprec.empno);
end loop;
no exit statement needed
implicit open,fetch,close occurs
Q.What is Raise_application_error ?
Raise_application_error is a procedure of package DBMS_STANDARD which allows to
issue an user_defined error messages from stored sub-program or database
trigger.
Q.How we can create a table in PL/SQL block. insert records into it??? is it
possible by some procedure or function?? please give example...
CREATE OR REPLACE PROCEDURE ddl_create_proc (p_table_name IN VARCHAR2)
AS
l_stmt VARCHAR2(200);
BEGIN
DBMS_OUTPUT.put_line('STARTING ');
l_stmt := 'create table '|| p_table_name || ' as (select * from emp )';
execute IMMEDIATE l_stmt;
DBMS_OUTPUT.put_line('end ');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('exception '||SQLERRM || 'message'||sqlcode);
END;
Q.In pl/sql functions what is use of out parameter even though we have return
statement.
With out parameters you can get the more than one out values in the calling program. It
is recommended not to use out parameters in functions. If you need more than one out
values then use procedures instead of functions.
Q.How packaged procedures and functions are called from the following?
a. Stored procedure or anonymous block
b. an application program such a PRC *C, PRO* COBOL
c. SQL *PLUS
a.PACKAGE NAME.PROCEDURE NAME (parameters);
variable := PACKAGE NAME.FUNCTION NAME (arguments);
EXEC SQL EXECUTE
b.
BEGIN
PACKAGE NAME.PROCEDURE NAME (parameters)
variable := PACKAGE NAME.FUNCTION NAME (arguments);
END;
END EXEC;
c. EXECUTE PACKAGE NAME.PROCEDURE if the procedures does not have any out/in-out
parameters. A function can not be called.
Q.What is SPOOL?
spool command used for printing the out put of the sql statments in a file. Eg.
spool /tmp/sql_out.txt
select emp_name, emp_id from emp where dept='sales';
spool off;
we can see the out on /tmp/sql_out.txt file.
SPOOL command creates a print file of the report.
Q.What is PL/SQL ?
PL/SQL is a procedural language that has both interactive SQL and procedural
programming language constructs such as iteration, conditional branching.
It is not possible. As triggers are defined for each table, if you use COMMIT of ROLLBACK
in a trigger, it affects logical transaction processing.
yes WE can use COMMIT and ROLLBACK triggers, but by using PRAGAMA
AUTONAMOUS_TRANSATIONS. Now the transation treated as a autonomous tansation.
Q.What is Multiple columns?
Multiple columns can be returned from a Nested Subquery.
Q.What is Savepoint?
Savepoint is a point within a particular transaction to which you may rollback without
rolling back the entire transaction.
-----------------------------------------------------
Also Read: