Database Questions and Answers – Triggers

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Triggers”.

1. 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.
a) Procedures
b) Triggers
c) Functions
d) None of the mentioned
View Answer

Answer: b
Explanation: Triggers are automatically generated when a particular operation takes place.

2. Triggers are supported in
a) Delete
b) Update
c) Views
d) All of the mentioned
View Answer

Answer: c
Explanation: The triggers run after an insert, update or delete on a table. They are not supported for views.

3. 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.
a) for insert, on
b) On, for insert
c) For, insert
d) None of the mentioned
View Answer

Answer: b
Explanation: The triggers run after an insert, update or delete on a table. They are not supported for views.
advertisement
advertisement

4. What are the after triggers?
a) Triggers generated after a particular operation
b) These triggers run after an insert, update or delete on a table
c) These triggers run after an insert, views, update or delete on a table
d) All of the mentioned
View Answer

Answer: b
Explanation: AFTER TRIGGERS can be classified further into three types as: AFTER INSERT Trigger, AFTER UPDATE Trigger, AFTER DELETE Trigger.

5. The variables in the triggers are declared using
a) –
b) @
c) /
d) /@
View Answer

Answer: b
Explanation: Example : declare @empid int; where empid is the variable.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. The default extension for an Oracle SQL*Plus file is:
a) .txt
b) .pls
c) .ora
d) .sql
View Answer

Answer: d
Explanation: Example :None.

7. Which of the following is NOT an Oracle-supported trigger?
a) BEFORE
b) DURING
c) AFTER
d) INSTEAD OF
View Answer

Answer: b
Explanation: Example: During trigger is not possible in any database.
advertisement

8. What are the different in triggers?
a) Define, Create
b) Drop, Comment
c) Insert, Update, Delete
d) All of the mentioned
View Answer

Answer: c
Explanation: Triggers are not possible for create, drop.

9. Triggers ________ enabled or disabled
a) Can be
b) Cannot be
c) Ought to be
d) Always
View Answer

Answer: a
Explanation: Triggers can be manipulated.
advertisement

10. Which prefixes are available to Oracle triggers?
a) : new only
b) : old only
c) Both :new and : old
d) Neither :new nor : old
View Answer

Answer: c
Explanation: None.

Sanfoundry Global Education & Learning Series – Database Management System.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.