Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
36Activity
0 of .
Results for:
No results containing your search query
P. 1
SQL Questions

SQL Questions

Ratings:

5.0

(1)
|Views: 304|Likes:
Published by api-3732630

More info:

Published by: api-3732630 on Oct 15, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

Interview Questions(SQL, PL/SQL, SQL Plus, Developer,
Database, anything dealing with Oracle) posted by pranavi on
February 10, 2002 at 16:45:16:
Try it out ..
GENERAL INTERVIEW QUESTIONS

1.What are the various types of Exceptions ?
User defined and Predefined Exceptions.
2.Can we define exceptions twice in same block ?

No.

3.What is the difference between a procedure and a function ?
Functions return a single variable by value whereas procedures do not
return any variable by value. Rather they return multiple variables by
passing variables by reference through their OUT parameter.
4.Can you have two functions with the same name in a PL/SQL block ?
Yes.
5.Can you have two stored functions with the same name ?
Yes.
6.Can you call a stored function in the constraint of a table ?
No.
7.What are the various types of parameter modes in a procedure ?
IN, OUT AND INOUT.
8.What is Over Loading and what are its restrictions ?
OverLoading means an object performing different functions depending
upon the no. of parameters or the data type of the parameters passed
to it.
9.Can functions be overloaded ?
Yes.
10.Can 2 functions have same name & input parameters but differ only
by return datatype
No.
11.What are the constructs of a procedure, function or a package ?
The constructs of a procedure, function or a package are :
variables and constants
cursors
exceptions
12.Why Create or Replace and not Drop and recreate procedures ?
So that Grants are not dropped.
13.Can you pass parameters in packages ? How ?
Yes. You can pass parameters to procedures or functions in a package.
14.What are the parts of a database trigger ?
The parts of a trigger are:
A triggering event or statement

A trigger restriction
A trigger action
15.What are the various types of database triggers ?
There are 12 types of triggers, they are combination of :
Insert, Delete and Update Triggers.
Before and After Triggers.
Row and Statement Triggers.
(3*2*2=12)
16.What is the advantage of a stored procedure over a database trigger
?We have control over the firing of a stored procedure but we have no

control over the firing of a trigger.
17.What is the maximum no. of statements that can be specified in a
trigger statement ?
One.
18.Can views be specified in a trigger statement ?
No
19.What are the values of :new and :old in Insert/Delete/Update Triggers
?INSERT : new = new value, old = NULL

DELETE : new = NULL, old = old value
UPDATE : new = new value, old = old value
20.What are cascading triggers? What is the maximum no of cascading
triggers at a time?
When a statement in a trigger body causes another trigger to be fired,
the triggers are said to be cascading. Max = 32.
21.What are mutating triggers ?
A trigger giving a SELECT on the table on which the trigger is written.
22.What are constraining triggers ?
A trigger giving an Insert/Updat e on a table having referential integrity
constraint on the triggering table.
23.Describe Oracle database's physical and logical structure ?
Physical : Data files, Redo Log files, Control file.
Logical : Tables, Views, Tablespaces, etc.
24.Can you increase the size of a tablespace ? How ?
Yes, by adding datafiles to it.
25.Can you increase the size of datafiles ? How ?
No (for Oracle 7.0)
Yes (for Oracle 7.3 by using the Resize clause- ---- Confirm !!).
26.What is the use of Control files ?
Contains pointers to locations of various data files, redo log files, etc.
27.What is the use of Data Dictionary ?
Used by Oracle to store information about various physical and logical
Oracle structures e.g. Tables, Tablespaces, datafiles, etc

28.What are the advantages of clusters ?
Access time reduced for joins.

29.What are the disadvantages of clusters ?
The time for Insert increases.
30.Can Long/Long RAW be clustered ?
No.
31.Can null keys be entered in cluster index, normal index ?
Yes.
32.Can Check constraint be used for self referential integrity ? How ?
Yes. In the CHECK condition for a column of a table, we can reference
some other column of the same table and thus enforce self referential
integrity.
33.What are the min. extents allocated to a rollback extent ?

Tw o

34.What are the states of a rollback segment ? What is the difference
between partly available and needs recovery ?
The various states of a rollback segment are :
ONLINE, OFFLINE, PARTLY AVAILABLE, NEEDS RECOVERY and INVALID.
35.What is the difference between unique key and primary key ?
Unique key can be null; Primary key cannot be null.
36.An insert statement followed by a create table statement followed
by rollback ? Will the rows be inserted ?
yes.
37.Can you define multiple savepoints ?
Yes.
38.Can you Rollback to any savepoint ?
Yes.
40.What is the maximum no. of columns a table can have ?
254.
41.What is the significance of the & and && operators in PL SQL ?
The & operator means that the PL SQL block requires user input for a
variable. The && operator means that the value of this variable should
be the same as inputted by the user previously for this same variable.
If a transaction is very large, and the rollback segment is not able to
hold the rollback information, then will the transaction span across
different rollback segments or will it terminate ?
It will terminate (Please check ).
42.Can you pass a parameter to a cursor ?
Explicit cursors can take parameters, as the example below shows. A
cursor parameter can appear in a query wherever a constant can
appear.
CURSOR c1 (median IN NUMBER) IS
SELECT job, ename FROM emp WHERE sal > median;

Activity (36)

You've already reviewed this. Edit your review.
1 hundred reads
Gopal Pal liked this
ankit boxer liked this
Sudheer Narne liked this
jayavardhankoti liked this
Vishal Gupta liked this
jayavardhankoti liked this
anushabcd liked this
sekhar1985 liked this
sta57 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->