Triggers(Engineering > Computer Science And Engineering > Dbms Questions And Answers ) Questions and Answers
Question 1. The default extension for an Oracle SQL*Plus file is:
.txt
.pls
.ora
.sql
Explanation:-
Answer: Option D. -> .sql
.sql
Question 2. Which prefixes are available to Oracle triggers?
: new only
: old only
Both :new and : old
Neither :new nor : old
Explanation:-
Answer: Option C. -> Both :new and : old
Both :new and : old
Question 3. Which of the following is NOT an Oracle-supported trigger?
BEFORE
DURING
AFTER
INSTEAD OF
Explanation:-
Answer: Option B. -> DURING
DURING
Question 4. Triggers ________ enabled or disabled
Can be
Cannot be
Ought to be
Always
Explanation:-
Answer: Option A. -> Can be
Can beTriggers can be manipulated.
Question 5. What are the different in triggers ?
Define, Create
Drop, Comment
Insert, Update, Delete
All of the mentioned
Explanation:-
Answer: Option C. -> Insert, Update, Delete
Insert, Update, DeleteTriggers are not possible for create,drop.
Question 6. A __________ is a special kind of a store procedure that executes in response to certain action on the table like insertion, deletion or updation of data.
Procedures
Triggers
Functions
None of the mentioned
Explanation:-
Answer: Option B. -> Triggers
TriggersTriggers are automatically generated when a particular operation takes place.
Question 7. The CREATE TRIGGER statement is used to create the trigger. THE _____ clause specifies the table name on which the trigger is to be attached. The ______ specifies that this is an AFTER INSERT trigger.
for insert, on
On, for insert
For, insert
Both a and c
Explanation:-
Answer: Option B. -> On, for insert
On, for insertThe triggers run after an insert, update or delete on a table. They are not supported for views.
Question 8. What are the after triggers ?
Triggers generated after a particular operation
These triggers run after an insert, update or delete on a table
These triggers run after an insert, views, update or delete on a table
Both b and c
Explanation:-
Answer: Option B. -> These triggers run after an insert, update or delete on a table
These triggers run after an insert, update or delete on a tableAFTER TRIGGERS can be classified further into three types as: AFTER INSERT Trigger, AFTER UPDATE Trigger. ,AFTER DELETE Trigger.
Question 9. Trigger are supported in
Delete
Update
Views
All of the mentioned
Explanation:-
Answer: Option C. -> Views
ViewsThe triggers run after an insert, update or delete on a table. They are not supported for views.
Question 10. The variables in the triggers are declared using
-
@
/
/@
Explanation:-
Answer: Option B. -> @
@ declare @empid int; where empid is the variable.