1. Which of the following events can trigger a database trigger?
- A. Insert
- B. Update
- C. Delete
- D. All of the above
2. What is a trigger in a database?
- A. A type of stored procedure
- B. A programmatic code that automatically responds to predefined events
- C. A table in the database
- D. A user interface element
3. Which of the following events can trigger a database trigger?
- A. Insert
- B. Update
- C. Delete
- D. All of the above
4. In SQL, when is a BEFORE trigger executed?
- A. Before an INSERT, UPDATE, or DELETE operation
- B. After an INSERT, UPDATE, or DELETE operation
- C. Before a SELECT operation
- D. After a SELECT operation
5. Which SQL statement is used to create a trigger?
- A. CREATE TRIGGER
- B. DECLARE TRIGGER
- C. ADD TRIGGER
- D. INITIATE TRIGGER
6. Which events can trigger the execution of an Apex trigger in Salesforce?
- A. Before Insert
- B. After Update
- C. Before Delete
- D. All of the above
7. What is the maximum number of triggers that can be defined on a single object in Salesforce?
- A. 1
- B. 2
- C. 5
- D. There is no limit.
8. Which trigger context variable is used to access the new records in a "before insert" trigger?
- A.
Trigger.new
- B.
Trigger.old
- C.
Trigger.newMap
- D.
Trigger.oldMap
9. In a "after update" trigger, how can you access the old field values of the records being updated?
- A.
Trigger.old
- B.
Trigger.new
- C.
Trigger.oldMap
- D.
Trigger.newMap
10.Which operation can be prevented in a "before delete" trigger by using the
addError
method?- A. Insert
- B. Update
- C. Delete
- D. Undelete
Answer Key:
Certainly! Here are the answers to the questions:
- D. All of the above
- B. A programmatic code that automatically responds to predefined events
- D. All of the above
- A. Before an INSERT, UPDATE, or DELETE operation
- A. CREATE TRIGGER
- D. All of the above
- C. 5
- A. Trigger.new
- C. Trigger.oldMap
- C. Delete
0 Comments
Post a Comment