You are on page 1of 3

Q.27. What is a snapshot ?

Ans: A snapshot is derived relation like a view. Unlike a view, a snapshot is


real not virtual. Snapshot tables not only have names, but also its own store
d data. Snapshot is used in a case, where the master table is rarely updated and
often queried and when users query the master table's
data from many nodes in the distributed database system.
Q.28. What is a database ?
Ans: A logically coherent collection of data with some inherent meaning; desig
ned, built and populated with data for a specific purpose.
Q.29. What are the kinds of integrity ?
Ans: Entity integrity and referential integrity.
Entity integrity rule state that no component of the primary key of a base rel
ation is allowed to accept nulls. Referential integrity rule states that the da
tabase must not contain any unmatched foreign key values. Self-referential Inte
grity -You can refer to the row from another row in one database (e.g. manager &
Empno in empmast ).
Primary key - The main key of a table.
Foreign key - When you are referring to the primary key of some other table.
Q.30. What is the difference between integrity constraint and database trigger
s ?
Ans: Triggers and declarative integrity constraints can both be used to constra
in data input. However, triggers and integrity constraints have significant dif
ferences. A declarative integrity constraints is a statement about the database
that is always true. A Constraint applies
to existing data in the table and any statement that manipulates the table. Tr
iggers constrains what transactions can do. A triggers does not apply to data lo
aded before the definitions of the triggers;therefore, it does not guarantee all
data in a table conforms to the rules established by an associated trigger. A
trigger enforces transactional constraints, i.e. a trigger only forces constrain
ts at the time that the data changes therefore a constraint such as "make sure t
hat the delivery date is at least seven days from today " should be enforced by
a trigger not a declarative constraint.
Q. 31 What is an exception hierarchy in PL/SQL ?
Ans: When an exception is raised, if PL/ SQL cannot find a handler for it in
the current block or subprogram, the exception propagates. That is, the except
ion reproduces it self in successive enclosing blocks until a handler is found
or there are no more blocks to search. In the latter case PL/SQL returns an unha
ndled exception error to the host environment . The exception for inner block ca
n be raised in outer block so whenever exception not handled in inner block, ou
ter block takes care of it.
Q.32. What is the result of greatest (1, NULL ) ?
Ans: 1.
Q.33. What do you mean by pragma EXCEPTION_init ?
Ans: To handle unnamed internal exceptions, you must use the OTHERS handler or
the pragma EXCEPTION_INIT. A pragma is a compiler directive, which can be
thought of as a parenthetical remark to the compiler. Pragma (also called ps
eudo instructions) are processed at compile time not at run time. They do not af
fect the meaning of the program, they simply convey the information to the com
piler. In PL/SQL the predefined pragma exception init tells the compiler to ass
ociate an exception name with an oracle error number that allows to refer
to any internal
exception-init in the declarative part of a PL/SQL block subprogram, package us
ing syntax pragma exception-init(exception_name,oracle error_number); where exce
ption_name is the a previously declared exception. The pragma must appear somew
here after the exception declaration in the
same declarative part as shown :
DECLARE
INSUFFICIENT_PRIVILEGES EXCEPTION;
PRAGMA EXCEPTION_INIT (INSUFFICIENT_PRIVILEGES, 1031);
Oracle returns error no. 1031 if e.g. you try to update a table which
you don't have privileges
BEGIN
............................
EXCEPTION
WHEN INSUFFICIENT_PRIVILEGES THEN
HANDLE THE ERROR
..............................
END;
Q.34. What is the result of least (1, NULL ) ?
Ans: 1.
Q35. In any database you are firing the command with order by(asc) col
umn_name and if that particular contains NULL values then the NULL value
s will appear at top or bottom?
Ans. The NULL values will appear on top.
Q36. What are macros in MENUS?
Ans. You can use macros commands to incorporate function keys processes into
selectable menu choices. You enter macros into the command line followed by a se
micolon as follows:
PRVMENU;
SQL-MENU will now move to the previous menu. You can combine more than one macr
o on the command line terminating each with a semicolon. In some cases you enter
command line arguments like this;
OSCIMD1 DIR; This will process an exit to the operating system and display a
list of the disk directory e.g.
ALPMENU - F9 - Go to application Menu.
MAINMENU - F3 - Go to main application Menu.
APLPARM - F6 - Run the application parameter form
MENUPARM - F5 - Run the Menu parameter form.
Q37. What is the difference between event level and database triggers?
Ans. . Event Level Triggers - These triggers are executed when a particular s
ituation or event cause them to execute.Some execute as the user enters the form
, block or field. Others execute as the cursor leaves the form, block or field.
Some are triggered by a keystroke such as a pending Commit or query. E.g. bloc
k level triggers, form level triggers, field level triggers. Etc. Dat
abase triggers are defined on a table, stored in the associated database and e
xecuted as a result of an INSERT, UPDATE, DELETE statement being issued ag
ainst a table no matter what user or application issues the statement.
Q 38. How do you update using report writer?
Ans. You cannot update using report writer.
Q. 39. What do you mean by parameters?
Ans. Oracle treats string literal defined for National Language Support
(NLS) parameters in the file as if they are in the database charac
ter set. Most parameters belong to one of the following groups:
1. Parameter that name things (such are files).
2. Parameter that set Limits (such as maximums)
3. Parameters affecting capacity, called variables parameters (such as t
he DB_BLOCK_BUFFERS parameter, which specifies the no. of datablocks to allocate
in the computers memory (for the SGA)). The database administrator can adjust
variable parameters to improve the performance of a database system. Exactl
y which parameters most affect a system is a function of numerous database chara
cteristics and variables.

Parameters is the information passed to subprograms.
Types - Actual ( Parameters in calling program).
Formal (Parameters in called subprogram).

You might also like