Pl/Sql - Triggers MCQ Questions And Answers
Triggers MCQs : This section focuses on "Triggers" in Pl/Sql. These Multiple Choice Questions (MCQs) should be practiced to improve the Pl/Sql skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. __________ are stored programs, which are automatically executed or fired when some events occur.
A. Procedure
B. Triggers
C. Collection
D. Transaction
View Answer
Ans : B
Explanation: Triggers are stored programs, which are automatically executed or fired when some events occur.
2. Triggers can be defined on the?
A. table
B. view
C. schema
D. All of the above
View Answer
Ans : D
Explanation: Triggers can be defined on the table, view, schema, or database with which the event is associated.
3. Which of the following specifies when the trigger will be executed?
A. BEFORE
B. AFTER
C. INSTEAD OF
D. All of the above
View Answer
Ans : D
Explanation: {BEFORE | AFTER | INSTEAD OF} : This specifies when the trigger will be executed. The INSTEAD OF clause is used for creating trigger on a view.
4. Which specifies the column name that will be updated?
A. For col_name
B. ON col_name
C. OF col_name
D. WHEN col_name
View Answer
Ans : C
Explanation: [OF col_name] : This specifies the column name that will be updated.
5. OLD and NEW references are not available for table-level triggers.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, OLD and NEW references are not available for table-level triggers.
6. Which of the following are benefits of Triggers?
A. Generating some derived column values automatically
B. Enforcing referential integrity
C. Event logging and storing information on table access
D. All of the above
View Answer
Ans : D
Explanation: All of the above are benefits of triggers
7. In which event(s) trigger is executed?
A. DDL
B. DML
C. Database Operation
D. All of the above
View Answer
Ans : D
Explanation: All of the above are event(s) trigger is executed
8. Which of the following is not an advantage of trigger?
A. Various column values are automatically generated by triggers
B. Maintains the integrity of referential
C. Tables are replicated asynchronously
D. Validating transactions and preventing them from being invalid
View Answer
Ans : C
Explanation: Trigger has this advantage of the tables to be replicated synchronously and not asynchronously.
9. Which clause is used to create trigger on a view?
A. BEFORE
B. INSTEAD OF
C. AFTER
D. None of the above
View Answer
Ans : B
Explanation: INSTEAD OF clause is used to create trigger on a view.
10. [ON table_name] specifies the name of the table associated with the trigger.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, [ON table_name] specifies the name of the table associated with the trigger.
Discussion