Deck 9: Database Triggers
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/54
العب
ملء الشاشة (f)
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
7
The WHEN clause of a trigger can be used only in row level triggers. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
9
Using the MULITPLE TRIGGER clause will allow more than one triggering event to be included in a single trigger.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
12
Only one triggering event can be addressed in a single trigger.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
13
A constraining table is one that is being modified by a DML action when a trigger is fired.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
14
The trigger body is a PL/SQL block that contains the actions that take place when the trigger fires.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
16
To remove a trigger from the system, the DEL TRIGGER statement is used. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
17
The FOLLOWS trigger option enables a developer to control the firing order of triggers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
18
Correlation identifiers allow us to refer to and use the row data values of a DML action. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
19
The ALTER TRIGGER statement is used to recompile, enable, or disable a trigger.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
20
The default timing of a trigger is row level and no code is included to achieve this timing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
[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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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;
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;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
A) system table
B) mutating table
C) transaction table
D) correlation table
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
AFTER UPDATE OF orderplaced ON bb_basket
A) INSERT
B) UPDATE
C) DELETE
D) AFTER
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
25
The default timing of a trigger is ____.
A) statement level
B) system level
C) row level
D) header level
A) statement level
B) system level
C) row level
D) header level
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
26
DDL events include all of the following, except ____.
A) ALTER
B) DROP
C) GRANT
D) DECLARE
A) ALTER
B) DROP
C) GRANT
D) DECLARE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
27
Row level options are only applicable for ____ events.
A) CREATE
B) INSERT
C) DECLARE
D) UPDATE and DELETE
A) CREATE
B) INSERT
C) DECLARE
D) UPDATE and DELETE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
29
All of the following would cause a trigger to fire, except ____.
A) BEFORE
B) INSERT
C) DELETE
D) UPDATE
A) BEFORE
B) INSERT
C) DELETE
D) UPDATE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
A) Statement level
B) Event level
C) DML level
D) Row level
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
A) ALTER
B) CREATE
C) System
D) Instead-Of
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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;
A) DEL TRIGGER trigger_name;
B) DELETE TRIGGER trigger_name;
C) REMOVE TRIGGER trigger_name;
D) DROP TRIGGER trigger_name;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
A) row level
B) system level
C) Instead-Of
D) database level
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
35
Database system events include all of the following, except ____.
A) LOGON
B) SHUTDOWN
C) GRANT
D) STARTUP
A) LOGON
B) SHUTDOWN
C) GRANT
D) STARTUP
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
A) mutating
B) system
C) database
D) key-preserved
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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;
A) ENABLE TRIGGER sales_trg COMPILE;
B) DROP TRIGGER sales_trg COMPILE;
C) COMPILE TRIGGER sales_trg COMPILE;
D) ALTER TRIGGER sales_trg COMPILE;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
A) BEFORE test_trg
B) PRECEDES test_trg
C) PRIOR test_trg
D) no option is available to control the firing order
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
42
How can triggers be applied to accomplish referential integrity?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
43
A(n) ___________________________ is one that is referenced via a foreign key constraint on the table that a trigger is modifying.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
44
___________________________ are clauses available within a trigger to allow separate handling of different database triggering events within a single trigger.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
45
The values checked in the ___________________________ clause of a trigger must reference correlation identifiers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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
A) MULTIPLE
B) MULTIPLE TRIGGER
C) COMPOUND
D) COMPOUND TRIGGER
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
47
A(n) ___________________________ is a PL/SQL block that executes in place of a DML action on a database view.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
48
To rebuild a database from a script, if you are using SQL Developer, open the file and click the ____________________ button.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
49
Discuss three critical pieces of information regarding the WHEN clause of a trigger.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
50
What is the difference between a mutating table and a key-preserved table?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
51
The ___________________________ level option is applicable only for UPDATE and DELETE events.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
52
A database ___________________________ is a block of PL/SQL code that runs automatically when a particular database event occurs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
54
The default timing of a trigger is ___________________________ level and no code is included to achieve this timing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck