Deck 9: Database Triggers

Full screen (f)
exit full mode
Question
LOB and OBJECT columns can be referenced in a trigger and can also be modified.
Use Space or
up arrow
down arrow
to flip the card.
Question
System triggers are typically used to allow the modification of data through a view on a view that is nonmodifiable.
Question
LONG RAW variables cannot be declared in triggers. _________________________
Question
The timing of triggers must be indicated as either BEGIN or END.
Question
If multiple triggers exist on a table, there is no guarantee about the order in which the triggers will be fired.
Question
A(n) mutating table is one that is referenced via a foreign key constraint on the table that a trigger is modifying. _________________________
Question
The WHEN clause of a trigger can be used only in row level triggers. _________________________
Question
LONG or LONG RAW variables can be declared in triggers and the NEW and OLD qualifiers cannot refer to these types of columns.
Question
Using the MULITPLE TRIGGER clause will allow more than one triggering event to be included in a single trigger.
Question
Numerous triggers can be constructed on one table and, therefore, a DML action on that table can fire off more than one trigger.
Question
A database trigger is tied to a database table or view and is implicitly fired by the database system when that table or view is affected with the associated DML action.
Question
Only one triggering event can be addressed in a single trigger.
Question
A constraining table is one that is being modified by a DML action when a trigger is fired.
Question
The trigger body is a PL/SQL block that contains the actions that take place when the trigger fires.
Question
One prominent limitation in the use of triggers is that they cannot issue transaction control statements of COMMIT, ROLLBACK, and SAVEPOINT.
Question
To remove a trigger from the system, the DEL TRIGGER statement is used. _________________________
Question
The FOLLOWS trigger option enables a developer to control the firing order of triggers.
Question
Correlation identifiers allow us to refer to and use the row data values of a DML action. _________________________
Question
The ALTER TRIGGER statement is used to recompile, enable, or disable a trigger.
Question
The default timing of a trigger is row level and no code is included to achieve this timing.
Question
CREATE [OR REPLACE] TRIGGER trigger_name [BEFORE, AFTER]
[List of DDL or Database System Events] [ON DATABASE |
SCHEMA] Trigger body;
The syntax above represents that of a(n) ____ trigger.

A) statement
B) row level
C) system
D) Instead-Of
Question
The statement ____ can be used to disable or enable a specific trigger.

A) ANALYZE TRIGGER trigger_name DISABLE|ENABLE;
B) ALTER TRIGGER trigger_name DISABLE|ENABLE;
C) AUDIT TRIGGER trigger_name DISABLE|ENABLE;
D) GRANT TRIGGER trigger_name DISABLE|ENABLE;
Question
A(n) ____ is a table that is being modified by a DML action when a trigger is fired.

A) system table
B) mutating table
C) transaction table
D) correlation table
Question
Which of the following events will cause the trigger to fire?
AFTER UPDATE OF orderplaced ON bb_basket

A) INSERT
B) UPDATE
C) DELETE
D) AFTER
Question
The default timing of a trigger is ____.

A) statement level
B) system level
C) row level
D) header level
Question
DDL events include all of the following, except ____.

A) ALTER
B) DROP
C) GRANT
D) DECLARE
Question
Row level options are only applicable for ____ events.

A) CREATE
B) INSERT
C) DECLARE
D) UPDATE and DELETE
Question
Which of the following statements is True about mutating tables?

A) A table in an UPDATE statement that fires a row level trigger affecting the same table is not considered a mutating table unless the UPDATE includes a subquery.
B) A table in a DELETE statement that fires a row level trigger affecting the same table is not considered a mutating table unless the DELETE includes a subquery.
C) A table in an INSERT statement that fires a row level trigger affecting the same table is not considered a mutating table unless the INSERT includes a subquery.
D) A table in a DROP statement that fires a row level trigger affecting the same table is not considered a mutating table unless the DROP includes a subquery.
Question
All of the following would cause a trigger to fire, except ____.

A) BEFORE
B) INSERT
C) DELETE
D) UPDATE
Question
CURSOR basketitem_curIS
SELECT idproduct, quantity, option1
FROM bb_basketitem
WHERE idbasket = :NEW.idbasket;
In the code fragment above, which of the following represents the correlation identifier?

A) idproduct
B) bb_basketitem
C) quantity
D) :NEW.idbasket
Question
Which of the following indicates that the trigger is fired only once, regardless of the number of rows affected by the DML statement?

A) Statement level
B) Event level
C) DML level
D) Row level
Question
____ triggers refer to database triggers that are fired by Data Definition Language (DDL) statements or database system events rather than DML actions.

A) ALTER
B) CREATE
C) System
D) Instead-Of
Question
The statement ____ correctly deletes a trigger.

A) DEL TRIGGER trigger_name;
B) DELETE TRIGGER trigger_name;
C) REMOVE TRIGGER trigger_name;
D) DROP TRIGGER trigger_name;
Question
A(n) ____ trigger fires whenever the event occurs, regardless of the schema in which it occurs.

A) row level
B) system level
C) Instead-Of
D) database level
Question
Database system events include all of the following, except ____.

A) LOGON
B) SHUTDOWN
C) GRANT
D) STARTUP
Question
CREATE OR REPLACE TRIGGER logon_trg
AFTER logon ON SCHEMA
BEGIN
INSERT INTO bb_audit_logon
VALUES (USER, SYSDATE);
END;
In the code fragment above, which of the ____ statement represents the system event.

A) logon
B) INSERT
C) SYSDATE
D) AFTER
Question
Which of the following statements is correct?

A) If multiple triggers exist on a table, the order in which the triggers will be fired can be set.
B) A BEFORE statement level trigger will fire before a BEFORE row level trigger.
C) If you have two statement level triggers, the order in which they are fired is dependent on the order in which they were written.
D) Only one trigger can be constructed per table.
Question
Which of the following statements is True?

A) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a constraining table.
B) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a key-preserved table.
C) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a mutating table.
D) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a conditional table.
Question
A(n) ____ table is one that is involved in a join and the keys of the original table are included in the keys of the resultant join.

A) mutating
B) system
C) database
D) key-preserved
Question
The statement ____ recompiles the trigger named sales_trg.

A) ENABLE TRIGGER sales_trg COMPILE;
B) DROP TRIGGER sales_trg COMPILE;
C) COMPILE TRIGGER sales_trg COMPILE;
D) ALTER TRIGGER sales_trg COMPILE;
Question
Which trigger option will force the trigger to fire before the test_trg trigger.

A) BEFORE test_trg
B) PRECEDES test_trg
C) PRIOR test_trg
D) no option is available to control the firing order
Question
How can triggers be applied to accomplish referential integrity?
Question
A(n) ___________________________ is one that is referenced via a foreign key constraint on the table that a trigger is modifying.
Question
___________________________ are clauses available within a trigger to allow separate handling of different database triggering events within a single trigger.
Question
The values checked in the ___________________________ clause of a trigger must reference correlation identifiers.
Question
The ____ trigger clause allows a trigger to include multiple triggering events in a single trigger.

A) MULTIPLE
B) MULTIPLE TRIGGER
C) COMPOUND
D) COMPOUND TRIGGER
Question
A(n) ___________________________ is a PL/SQL block that executes in place of a DML action on a database view.
Question
To rebuild a database from a script, if you are using SQL Developer, open the file and click the ____________________ button.
Question
Discuss three critical pieces of information regarding the WHEN clause of a trigger.
Question
What is the difference between a mutating table and a key-preserved table?
Question
The ___________________________ level option is applicable only for UPDATE and DELETE events.
Question
A database ___________________________ is a block of PL/SQL code that runs automatically when a particular database event occurs.
Question
In the syntax of the CREATE TRIGGER statement, the ____________________ clause can be used to change the OLD and NEW qualifier names to something of your choice.
Question
The default timing of a trigger is ___________________________ level and no code is included to achieve this timing.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/54
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 9: Database Triggers
1
LOB and OBJECT columns can be referenced in a trigger and can also be modified.
False
2
System triggers are typically used to allow the modification of data through a view on a view that is nonmodifiable.
False
3
LONG RAW variables cannot be declared in triggers. _________________________
True
4
The timing of triggers must be indicated as either BEGIN or END.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
5
If multiple triggers exist on a table, there is no guarantee about the order in which the triggers will be fired.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
6
A(n) mutating table is one that is referenced via a foreign key constraint on the table that a trigger is modifying. _________________________
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
7
The WHEN clause of a trigger can be used only in row level triggers. _________________________
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
8
LONG or LONG RAW variables can be declared in triggers and the NEW and OLD qualifiers cannot refer to these types of columns.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
9
Using the MULITPLE TRIGGER clause will allow more than one triggering event to be included in a single trigger.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
10
Numerous triggers can be constructed on one table and, therefore, a DML action on that table can fire off more than one trigger.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
11
A database trigger is tied to a database table or view and is implicitly fired by the database system when that table or view is affected with the associated DML action.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
12
Only one triggering event can be addressed in a single trigger.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
13
A constraining table is one that is being modified by a DML action when a trigger is fired.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
14
The trigger body is a PL/SQL block that contains the actions that take place when the trigger fires.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
15
One prominent limitation in the use of triggers is that they cannot issue transaction control statements of COMMIT, ROLLBACK, and SAVEPOINT.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
16
To remove a trigger from the system, the DEL TRIGGER statement is used. _________________________
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
17
The FOLLOWS trigger option enables a developer to control the firing order of triggers.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
18
Correlation identifiers allow us to refer to and use the row data values of a DML action. _________________________
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
19
The ALTER TRIGGER statement is used to recompile, enable, or disable a trigger.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
20
The default timing of a trigger is row level and no code is included to achieve this timing.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
21
CREATE [OR REPLACE] TRIGGER trigger_name [BEFORE, AFTER]
[List of DDL or Database System Events] [ON DATABASE |
SCHEMA] Trigger body;
The syntax above represents that of a(n) ____ trigger.

A) statement
B) row level
C) system
D) Instead-Of
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
22
The statement ____ can be used to disable or enable a specific trigger.

A) ANALYZE TRIGGER trigger_name DISABLE|ENABLE;
B) ALTER TRIGGER trigger_name DISABLE|ENABLE;
C) AUDIT TRIGGER trigger_name DISABLE|ENABLE;
D) GRANT TRIGGER trigger_name DISABLE|ENABLE;
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
23
A(n) ____ is a table that is being modified by a DML action when a trigger is fired.

A) system table
B) mutating table
C) transaction table
D) correlation table
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
24
Which of the following events will cause the trigger to fire?
AFTER UPDATE OF orderplaced ON bb_basket

A) INSERT
B) UPDATE
C) DELETE
D) AFTER
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
25
The default timing of a trigger is ____.

A) statement level
B) system level
C) row level
D) header level
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
26
DDL events include all of the following, except ____.

A) ALTER
B) DROP
C) GRANT
D) DECLARE
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
27
Row level options are only applicable for ____ events.

A) CREATE
B) INSERT
C) DECLARE
D) UPDATE and DELETE
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following statements is True about mutating tables?

A) A table in an UPDATE statement that fires a row level trigger affecting the same table is not considered a mutating table unless the UPDATE includes a subquery.
B) A table in a DELETE statement that fires a row level trigger affecting the same table is not considered a mutating table unless the DELETE includes a subquery.
C) A table in an INSERT statement that fires a row level trigger affecting the same table is not considered a mutating table unless the INSERT includes a subquery.
D) A table in a DROP statement that fires a row level trigger affecting the same table is not considered a mutating table unless the DROP includes a subquery.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
29
All of the following would cause a trigger to fire, except ____.

A) BEFORE
B) INSERT
C) DELETE
D) UPDATE
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
30
CURSOR basketitem_curIS
SELECT idproduct, quantity, option1
FROM bb_basketitem
WHERE idbasket = :NEW.idbasket;
In the code fragment above, which of the following represents the correlation identifier?

A) idproduct
B) bb_basketitem
C) quantity
D) :NEW.idbasket
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
31
Which of the following indicates that the trigger is fired only once, regardless of the number of rows affected by the DML statement?

A) Statement level
B) Event level
C) DML level
D) Row level
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
32
____ triggers refer to database triggers that are fired by Data Definition Language (DDL) statements or database system events rather than DML actions.

A) ALTER
B) CREATE
C) System
D) Instead-Of
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
33
The statement ____ correctly deletes a trigger.

A) DEL TRIGGER trigger_name;
B) DELETE TRIGGER trigger_name;
C) REMOVE TRIGGER trigger_name;
D) DROP TRIGGER trigger_name;
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
34
A(n) ____ trigger fires whenever the event occurs, regardless of the schema in which it occurs.

A) row level
B) system level
C) Instead-Of
D) database level
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
35
Database system events include all of the following, except ____.

A) LOGON
B) SHUTDOWN
C) GRANT
D) STARTUP
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
36
CREATE OR REPLACE TRIGGER logon_trg
AFTER logon ON SCHEMA
BEGIN
INSERT INTO bb_audit_logon
VALUES (USER, SYSDATE);
END;
In the code fragment above, which of the ____ statement represents the system event.

A) logon
B) INSERT
C) SYSDATE
D) AFTER
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following statements is correct?

A) If multiple triggers exist on a table, the order in which the triggers will be fired can be set.
B) A BEFORE statement level trigger will fire before a BEFORE row level trigger.
C) If you have two statement level triggers, the order in which they are fired is dependent on the order in which they were written.
D) Only one trigger can be constructed per table.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
38
Which of the following statements is True?

A) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a constraining table.
B) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a key-preserved table.
C) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a mutating table.
D) The body of a trigger cannot read or modify the primary, unique, or foreign key columns of a conditional table.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
39
A(n) ____ table is one that is involved in a join and the keys of the original table are included in the keys of the resultant join.

A) mutating
B) system
C) database
D) key-preserved
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
40
The statement ____ recompiles the trigger named sales_trg.

A) ENABLE TRIGGER sales_trg COMPILE;
B) DROP TRIGGER sales_trg COMPILE;
C) COMPILE TRIGGER sales_trg COMPILE;
D) ALTER TRIGGER sales_trg COMPILE;
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
41
Which trigger option will force the trigger to fire before the test_trg trigger.

A) BEFORE test_trg
B) PRECEDES test_trg
C) PRIOR test_trg
D) no option is available to control the firing order
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
42
How can triggers be applied to accomplish referential integrity?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
43
A(n) ___________________________ is one that is referenced via a foreign key constraint on the table that a trigger is modifying.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
44
___________________________ are clauses available within a trigger to allow separate handling of different database triggering events within a single trigger.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
45
The values checked in the ___________________________ clause of a trigger must reference correlation identifiers.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
46
The ____ trigger clause allows a trigger to include multiple triggering events in a single trigger.

A) MULTIPLE
B) MULTIPLE TRIGGER
C) COMPOUND
D) COMPOUND TRIGGER
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
47
A(n) ___________________________ is a PL/SQL block that executes in place of a DML action on a database view.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
48
To rebuild a database from a script, if you are using SQL Developer, open the file and click the ____________________ button.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
49
Discuss three critical pieces of information regarding the WHEN clause of a trigger.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
50
What is the difference between a mutating table and a key-preserved table?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
51
The ___________________________ level option is applicable only for UPDATE and DELETE events.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
52
A database ___________________________ is a block of PL/SQL code that runs automatically when a particular database event occurs.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
53
In the syntax of the CREATE TRIGGER statement, the ____________________ clause can be used to change the OLD and NEW qualifier names to something of your choice.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
54
The default timing of a trigger is ___________________________ level and no code is included to achieve this timing.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 54 flashcards in this deck.