T4Tutorials .PK

Triggers MCQs

Q#1: In DBMS, a trigger is:
(A) A set of actions automatically executed in response to certain events on a table or view
(B) A backup operation
(C) An index structure
(D) A query optimizer
Answer: (A) A set of actions automatically executed in response to certain events on a table or view

Q#2: Triggers are activated by:
(A) Events such as INSERT, UPDATE, or DELETE
(B) Backup operations
(C) Indexing
(D) Encryption
Answer: (A) Events such as INSERT, UPDATE, or DELETE

Q#3: A trigger consists of:
(A) Event, condition, and action
(B) Only event
(C) Only condition
(D) Only action
Answer: (A) Event, condition, and action

Q#4: BEFORE triggers are executed:
(A) Before the triggering event occurs
(B) After the triggering event occurs
(C) During backup
(D) Only during index creation
Answer: (A) Before the triggering event occurs

Q#5: AFTER triggers are executed:
(A) After the triggering event occurs
(B) Before the triggering event occurs
(C) During normalization
(D) Only during backup
Answer: (A) After the triggering event occurs

Q#6: Row-level triggers execute:
(A) Once for each row affected by the triggering event
(B) Once per table
(C) Only during backup
(D) Only during encryption
Answer: (A) Once for each row affected by the triggering event

Q#7: Statement-level triggers execute:
(A) Once per triggering statement, regardless of number of rows affected
(B) Once per row
(C) During backup only
(D) During index creation
Answer: (A) Once per triggering statement, regardless of number of rows affected

Q#8: Triggers can be used to enforce:
(A) Business rules and data integrity constraints
(B) Backup operations
(C) Index creation
(D) Encryption only
Answer: (A) Business rules and data integrity constraints

Q#9: Triggers can prevent:
(A) Invalid operations on tables
(B) Backup failures
(C) Index corruption
(D) Encryption failures
Answer: (A) Invalid operations on tables

Q#10: A trigger can call:
(A) Stored procedures and functions
(B) Backup scripts only
(C) Encryption algorithms only
(D) Index creation scripts only
Answer: (A) Stored procedures and functions

Q#11: Recursive triggers occur when:
(A) A trigger activates itself either directly or indirectly
(B) Backup is recursive
(C) Index creation is recursive
(D) Encryption repeats automatically
Answer: (A) A trigger activates itself either directly or indirectly

Q#12: Advantages of triggers include:
(A) Automatic enforcement of rules, auditing, and derived column updates
(B) Only backup
(C) Only encryption
(D) Only indexing
Answer: (A) Automatic enforcement of rules, auditing, and derived column updates

Q#13: Disadvantages of triggers include:
(A) Hidden logic, maintenance complexity, and possible performance overhead
(B) Backup only
(C) Encryption only
(D) Indexing only
Answer: (A) Hidden logic, maintenance complexity, and possible performance overhead

Q#14: A trigger can be disabled using:
(A) ALTER TRIGGER … DISABLE
(B) DROP TABLE
(C) CREATE INDEX
(D) BACKUP DATABASE
Answer: (A) ALTER TRIGGER … DISABLE

Q#15: Triggers are stored:
(A) In the database
(B) In backup files
(C) In indexes
(D) On client machines
Answer: (A) In the database

Q#16: Compound triggers are:
(A) Triggers that combine multiple timing points in a single trigger
(B) Only row-level triggers
(C) Only statement-level triggers
(D) Backup triggers
Answer: (A) Triggers that combine multiple timing points in a single trigger

Q#17: Triggers can be used for auditing:
(A) Recording changes made to tables
(B) Normalizing tables
(C) Encrypting data
(D) Index optimization
Answer: (A) Recording changes made to tables

Q#18: INSTEAD OF triggers are used on:
(A) Views to perform insert, update, or delete operations
(B) Base tables only
(C) Backup files only
(D) Indexes only
Answer: (A) Views to perform insert, update, or delete operations

Q#19: Row-level triggers are also called:
(A) FOR EACH ROW triggers
(B) FOR EACH TABLE triggers
(C) Backup triggers
(D) Encryption triggers
Answer: (A) FOR EACH ROW triggers

Q#20: Statement-level triggers are also called:
(A) FOR EACH STATEMENT triggers
(B) FOR EACH ROW triggers
(C) Backup triggers
(D) Encryption triggers
Answer: (A) FOR EACH STATEMENT triggers

Q#21: A trigger cannot directly:
(A) Commit or rollback transactions in some DBMS
(B) Update tables
(C) Call procedures
(D) Enforce constraints
Answer: (A) Commit or rollback transactions in some DBMS

Q#22: Triggers help maintain:
(A) Referential and entity integrity
(B) Only backup
(C) Only encryption
(D) Only indexing
Answer: (A) Referential and entity integrity

Q#23: BEFORE triggers are commonly used for:
(A) Validation of data before insertion or update
(B) Backup only
(C) Encryption only
(D) Index optimization
Answer: (A) Validation of data before insertion or update

Q#24: AFTER triggers are commonly used for:
(A) Auditing or updating derived columns after operation
(B) Backup only
(C) Encryption only
(D) Index optimization
Answer: (A) Auditing or updating derived columns after operation

Q#25: Cascading triggers occur when:
(A) One trigger fires another trigger
(B) Backup triggers fire
(C) Encryption triggers fire
(D) Index triggers fire
Answer: (A) One trigger fires another trigger

Q#26: Triggers can be used to implement:
(A) Complex business logic enforcement
(B) Backup only
(C) Encryption only
(D) Indexing only
Answer: (A) Complex business logic enforcement

Q#27: Main difference between triggers and stored procedures is:
(A) Triggers execute automatically; stored procedures execute manually
(B) Stored procedures are faster
(C) Triggers are slower
(D) Stored procedures cannot access tables
Answer: (A) Triggers execute automatically; stored procedures execute manually

Q#28: Multiple triggers on the same table can:
(A) Execute in a defined or DBMS-specific order
(B) Never execute together
(C) Only execute during backup
(D) Only execute on indexes
Answer: (A) Execute in a defined or DBMS-specific order

Q#29: Triggers improve:
(A) Data integrity, auditing, and automation
(B) Only backup
(C) Only encryption
(D) Only indexing
Answer: (A) Data integrity, auditing, and automation

Q#30: Main purpose of triggers in DBMS is:
(A) Automatic response to certain events to enforce rules and maintain integrity
(B) Backup only
(C) Encrypt only
(D) Index only
Answer: (A) Automatic response to certain events to enforce rules and maintain integrity

Exit mobile version