Database SA3 Flashcards

1
Q

Triggers like subprograms may or may not have parameters.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Triggers can either be row-level or statement-level.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A ________ are triggers that are not part of the database.

A

APPLICATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Database triggers execute automatically whenever a data event such as _______ occurs.

A

DML, DDL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A _______ triggers execute whenever a particular event occurs within an application.

A

APPLICATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Event determines which DML operation causes the trigger to fire. Values are DELETE, UPDATE [OF column], and ______.

A

INSERT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The _______ trigger fires only once for each execution of the triggering statement (even if no rows are affected).

A

STATEMENT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The following determines when a DML trigger will execute: BEFORE, AFTER, ________.

A

INSTEAD OF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The ____ trigger timing executes the trigger body after the triggering DML event on a table.

A

AFTER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The ________trigger is the default type of DML trigger.

A

STATEMENT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Exception section is not allowed in triggers.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

You specify a row trigger using FOR EACH ROW clause.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A DML trigger is a database trigger.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The following determines when a DML trigger will execute: BEFORE, AFTER, INSTEAD.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The given trigger header contains no error.

CREATE OR REPLACE TRIGGER emp_del_trigg AFTER DELETE ON employees

BEGIN <assume valid PL/SQL statements here> END;

Group of answer choices

True

False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A MUTATE table is an object that is currently being modified by a DML statement.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

The CALL is a statement is used to invoke procedure in a trigger.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The ON SCHEMA cannot be used with SHUTDOWN and STARTUP events.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

DDL Triggers can either be ON DATABASE or ON SCHEMA.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The database event triggers are fired by non-SQL events in the database.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The __________ cannot be used with SHUTDOWN and STARTUP events.

A

ON SCHEMA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

The ON SCHEMA cannot be used with ____________ events.

A

Shutdown and startup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

The ______ triggers can either be ON DATABASE or ON SCHEMA.

A

DDL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

The code below will:

CREATE OR REPLACE TRIGGER log_create_trigg
AFTER CREATE ON SCHEMA
BEGIN
INSERT INTO log_table VALUES (USER, SYSDATE);
END;

A

The trigger fires whenever any type of object is created in your schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
The ______ fires the trigger only for your own sessions.
ON SCHEMA
26
The USER_TRIGGERS is used to view the detailed code and status of the trigger in data dictionary.
True
27
DBA shutting down the database is a system event.
True
28
A user connecting to a schema or database is a _____ event.
SYSTEM
29
To create triggers in other user’s schemas, you need to the __________ privilege.
CREATE ANY TRIGGER
30
What will cause an error in the given trigger declaration? CREATE OR REPLACE TRIGGER log_salchange_trigg AFTER UPDATE OF salary ON employees IS DECLARE VDATE NUMBER := SYSDATE; BEGIN INSERT INTO log_table (user_id, logon_date) VALUES (USER, VDATE); END;
IS
31
The conditional predicates are: _______, INSERTING, DELETING.
UPDATING
32
The ____ trigger timing executes the trigger body before the triggering DML event on a table.
BEFORE
33
The ________ keywords are automatically declared Boolean variables which are set to TRUE or FALSE by the Oracle server. These keywords may be used in the trigger body instead of UPDATE, INSERT, DELETE.
Conditional Predicates
34
In creating trigger you need to consider the timing and _______.
EVENT
35
TCL statement is allowed in triggers.
False
36
A statement-level trigger fires once for each row affected by the triggering DML statement, either just BEFORE the row is processed or just AFTER.
False
37
A row trigger fires once for each row affected by the triggering DML statement, either just BEFORE the row is processed or just AFTER.
True
38
The row trigger is the default type of DML trigger.
False
39
The ON SCHEMA fires the trigger only for your own sessions.
True
40
A statement trigger cannot SELECT from a mutating table.
FALSE
41
You cannot create a DDL trigger that refers to a specific database object.
True
42
A ________ fires the trigger for DDL on all schemas in the database.
ON DATABASE
43
A ________trigger must not query or modify a mutating table.
ROW-LEVEL
44
A ________ table is an object that is currently being modified by a DML statement.
MUTATING TABLE
45
To create triggers in other user’s schemas, you need the CREATE TRIGGER privilege.
False
46
You can use triggers to generate derived column values automatically.
True
47
Trigger executes ________ whenever the associated action occurs.
Implicitly
48
The_________ allow specified actions to be performed automatically within the database, without having to write extra application code.
TRIGGER
49
A _____ trigger execute automatically whenever a data event or a system event occurs.
DATABASE
50
Event determines which DML operation causes the trigger to fire. Values are INSERT, UPDATE [OF column], and ______.
DELETE
51
You specify a row trigger using FOR ROW clause.
False
52
A row trigger may SELECT from a mutating table.
False
53
A MUTATING table is an object that is currently being modified by a DML statement.
True
54
The use INSTEAD OF with Database Event triggers is possible.
False
55
The _______ is a statement is used to invoke procedure in a trigger.
CALL
56
Which trigger is applicable in the following scenario: The DBA starts up, or shuts down, the database.
Database Event Trigger
57
All constructs declared in the package specification are automatically public constructs.
True
58
To create triggers in other user’s schemas, you need the CREATE ANY TRIGGER privilege.
True
59
TCL are allowed in triggers.
False
60
Since triggers are never explicitly invoked, they cannot receive ________.
All the options
61
A _______ trigger is a trigger that is automatically fired (executed) whenever an SQL DML statement (INSERT, UPDATE, or DELETE) is executed.
DML
62
DML Trigger is classified in two ways: when they execute, how they execute.
False
63
The Database Event Trigger are fired by non-SQL events in the database.
True
64
A ON DATABASE fires the trigger for DDL on all schemas in the database.
True
65
The database triggers are fired by non-SQL events in the database.
False
66
The ON SCHEMA fires the trigger only for _______ sessions.
OWN
67
The _________ are fired by non-SQL events in the database.
Database event trigger
68
“Public” means that the package construct (variable, procedure, function, and so on) can be seen and executed from outside the package.
True
69
Package body contains only subprograms that are declared in the package specification.
False
70
Database triggers execute automatically whenever a data event such as DML or DDL occurs.
True
71
Which statement is used to enable a database trigger?
ALTER TRIGGER trigger_name enable
72
The conditional predicates are: _______, INSERTING, UPDATING.
DELETING
73
A ________ fires once for each row affected by the triggering DML statement, either just BEFORE the row is processed or just AFTER.
ROW TRIGGER
74
In creating trigger you need to consider the timing and event.
True
75
The Conditional Predicates keywords are automatically declared Boolean variables which are set to TRUE or FALSE by the Oracle server. These keywords may be used in the trigger body instead of UPDATE, INSERT, DELETE.
True
76
The PREDICATE keywords are automatically declared Boolean variables which are set to TRUE or FALSE by the Oracle server. These keywords may be used in the trigger body instead of UPDATE, INSERT, DELETE.
False
77
The ON DATABASE fires the trigger only for your own sessions.
False
78
DML Triggers can either be ON DATABASE or ON SCHEMA.
False
79
A ON SCHEMA fires the trigger for DDL on all schemas in the database.
False
80
A DML trigger may have more than one triggering event.
True
81
DML Trigger is classified in two ways: when they execute, how many times they execute.
True
82
A MUTE table is an object that is currently being modified by a DML statement.
False
83
The implementation (i.e., the detailed code) of a procedure or function that is declared in a ________ is done in the package body.
PACKAGE SPECIFICATION
84
To invoke package subprograms, fully ____the (public) subprogram with its PACKAGE NAME.
QUALIFY
85
Package specification is a container that enables you to group together related PL/SQL subprograms, variables, cursors, and exceptions.
False
86
A SYSTEM trigger execute automatically whenever a data event or a system event occurs.
False
87
Which will not cause a trigger to fire? Group of answer choices DML operations on a view CREATE and ALTER statement DML operations on a table Not in the options
Not in the options
88
You specify a row trigger using __________clause.
FOR EACH ROW
89
The given trigger header below contains no error. CREATE OR REPLACE TRIGGER emp_del_trigg AFTER DELETE ON employees BEGIN END; Group of answer choices True False
True
90
A row-level trigger must not query or modify a mutating table.
True
91
You cannot create a ______ trigger that refers to a specific database object.
DDL
92
Encapsulation refers to a two-part structure in which the detailed package body code is invisible to the calling environment, which can only see the. If changes to the code are needed, the body can be edited and recompiled without having to edit or recompile the specification.
True
93
In package specification, we declare constructs that will not be visible to the calling environment.
False
94
A DATA trigger execute automatically whenever a data event or a system event occurs.
False
95
Event determines which DML operation causes the trigger to fire. Values are INSERT, UPDATE [OF column], and DELETE.
True
96
The EXECUTE is a statement is used to invoke procedure in a trigger.
False
97
Since triggers are never explicitly invoked, they cannot receive parameters.
True
98
You can use triggers to generate derived column values _________.
AUTOMATICALLY
99
A DML trigger is a trigger that is automatically fired (executed) whenever an SQL DML statement (INSERT, UPDATE, or DELETE) is executed.
True
100
An ON DATABASE fires the trigger for ____ on all schemas in the database.
DDL
101
A DML trigger is a trigger that is automatically fired whenever an SQL DML statement (INSERT, UPDATE, or DELETE) is executed. True or False?
True
102
An ON DATABASE fires the trigger for ____ on all schemas in the database.
DDL
103
The conditional predicates are: _______, DELETING, UPDATING.
INSERTING