Sei sulla pagina 1di 4

Test: Quiz: Introduction to Triggers 1.

While editing a document in Microsoft Word, you go to the FILE menu and SAVE your work. To do this, Microsoft Word has executed an application trigger. True or False? Mark for Review (1) Points True (*) False

Correct 2. You can use a database trigger to prevent invalid transactions from bei ng committed. True or False? Mark for Review (1) Points True (*) False

Correct 3. Which of the following events could NOT automatically fire a database t rigger? Mark for Review (1) Points A user logging on to the database A SQL INSERT statement You click your mouse on a button to choose the correct answer to this qu estion (*) A DML operation on a view The Database Administrator shuts down the database

Correct 4. Which of the following are NOT allowed within a database trigger? (Choo se two) Mark for Review (1) Points

(Choose all correct answers) COMMIT (*) A call to a packaged procedure INSERT A Boolean variable SAVEPOINT (*)

Correct 5. A database trigger is a PL/SQL stored subprogram which is explicitly in voked just like a procedure or a function. True or False? Mark for Review (1) Points True False (*)

Correct 6. A user's schema contains procedure MYPROC, function MYFUNC, trigger MYT RIGG and package MYPACK which contains a public procedure PACKPROC. These subpro grams have no parameters, and the function returns a NUMBER. Which of the follow ing calls to these objects (from an anonymous block) are incorrect? (Choose two) Mark for Review (1) Points (Choose all correct answers) mypack.packproc; mytrigg; (*) myproc; v_number := myfunc; IF NOT myfunc THEN ... (*)

Correct 7. Which of the following could NOT be done by a database trigger? Mark for Review (1) Points Enforcing a complex business rule Enforcing a complex database security check Recalculating the total salary bill for a department whenever an employe e's salary is changed Ensuring that a student never arrives late for a class (*) Keeping a log of how many rows have been inserted into a table

Correct 8. Which of the following best describes a database trigge r? Mark for Review (1) Points It allows users to log on to the database It executes automatically whenever a particular event occurs within the database (*) It prevents unique constraints from being violated It executes automatically whenever a user clicks on a button with their mouse It allows foreign key constraints to be violated

Correct 9. Which of the following are good guidelines to follow when creating trig gers? (Choose two) Mark for Review (1) Points (Choose all correct answers)

Be aware of recursive and cascading effects (*) Where possible, use triggers to enforce NOT NULL constraints Avoid lengthy trigger logic by creating a procedure and invoking it from within the trigger (*) Use triggers to replace functionality which is already built into the da tabase Always create more triggers than you need, because it is better to be sa fe

Correct 10. A business rule states that an employee's salary must be between 4000 a nd 30000. We could enforce this rule using a check constraint, but it is better to use a database trigger. True or False? Mark for Review (1) Points True False (*)

Correct

Potrebbero piacerti anche