Database SA3 Flashcards
Triggers like subprograms may or may not have parameters.
False
Triggers can either be row-level or statement-level.
True
A ________ are triggers that are not part of the database.
APPLICATION
Database triggers execute automatically whenever a data event such as _______ occurs.
DML, DDL
A _______ triggers execute whenever a particular event occurs within an application.
APPLICATION
Event determines which DML operation causes the trigger to fire. Values are DELETE, UPDATE [OF column], and ______.
INSERT
The _______ trigger fires only once for each execution of the triggering statement (even if no rows are affected).
STATEMENT
The following determines when a DML trigger will execute: BEFORE, AFTER, ________.
INSTEAD OF
The ____ trigger timing executes the trigger body after the triggering DML event on a table.
AFTER
The ________trigger is the default type of DML trigger.
STATEMENT
Exception section is not allowed in triggers.
False
You specify a row trigger using FOR EACH ROW clause.
True
A DML trigger is a database trigger.
True
The following determines when a DML trigger will execute: BEFORE, AFTER, INSTEAD.
False
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
True
A MUTATE table is an object that is currently being modified by a DML statement.
False
The CALL is a statement is used to invoke procedure in a trigger.
True
The ON SCHEMA cannot be used with SHUTDOWN and STARTUP events.
True
DDL Triggers can either be ON DATABASE or ON SCHEMA.
True
The database event triggers are fired by non-SQL events in the database.
True
The __________ cannot be used with SHUTDOWN and STARTUP events.
ON SCHEMA
The ON SCHEMA cannot be used with ____________ events.
Shutdown and startup
The ______ triggers can either be ON DATABASE or ON SCHEMA.
DDL
The code below will:
CREATE OR REPLACE TRIGGER log_create_trigg
AFTER CREATE ON SCHEMA
BEGIN
INSERT INTO log_table VALUES (USER, SYSDATE);
END;
The trigger fires whenever any type of object is created in your schema.
The ______ fires the trigger only for your own sessions.
ON SCHEMA
The USER_TRIGGERS is used to view the detailed code and status of the trigger in data dictionary.
True
DBA shutting down the database is a system event.
True
A user connecting to a schema or database is a _____ event.
SYSTEM
To create triggers in other user’s schemas, you need to the __________ privilege.
CREATE ANY TRIGGER
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
The conditional predicates are: _______, INSERTING, DELETING.
UPDATING
The ____ trigger timing executes the trigger body before the triggering DML event on a table.
BEFORE
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
In creating trigger you need to consider the timing and _______.
EVENT
TCL statement is allowed in triggers.
False
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
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
The row trigger is the default type of DML trigger.
False
The ON SCHEMA fires the trigger only for your own sessions.
True
A statement trigger cannot SELECT from a mutating table.
FALSE
You cannot create a DDL trigger that refers to a specific database object.
True
A ________ fires the trigger for DDL on all schemas in the database.
ON DATABASE
A ________trigger must not query or modify a mutating table.
ROW-LEVEL
A ________ table is an object that is currently being modified by a DML statement.
MUTATING TABLE
To create triggers in other user’s schemas, you need the CREATE TRIGGER privilege.
False
You can use triggers to generate derived column values automatically.
True
Trigger executes ________ whenever the associated action occurs.
Implicitly
The_________ allow specified actions to be performed automatically within the database, without having to write extra application code.
TRIGGER
A _____ trigger execute automatically whenever a data event or a system event occurs.
DATABASE
Event determines which DML operation causes the trigger to fire. Values are INSERT, UPDATE [OF column], and ______.
DELETE
You specify a row trigger using FOR ROW clause.
False
A row trigger may SELECT from a mutating table.
False
A MUTATING table is an object that is currently being modified by a DML statement.
True
The use INSTEAD OF with Database Event triggers is possible.
False
The _______ is a statement is used to invoke procedure in a trigger.
CALL
Which trigger is applicable in the following scenario:
The DBA starts up, or shuts down, the database.
Database Event Trigger
All constructs declared in the package specification are automatically public constructs.
True
To create triggers in other user’s schemas, you need the CREATE ANY TRIGGER privilege.
True
TCL are allowed in triggers.
False
Since triggers are never explicitly invoked, they cannot receive ________.
All the options
A _______ trigger is a trigger that is automatically fired (executed) whenever an SQL DML statement (INSERT, UPDATE, or DELETE) is executed.
DML
DML Trigger is classified in two ways: when they execute, how they execute.
False
The Database Event Trigger are fired by non-SQL events in the database.
True
A ON DATABASE fires the trigger for DDL on all schemas in the database.
True
The database triggers are fired by non-SQL events in the database.
False
The ON SCHEMA fires the trigger only for _______ sessions.
OWN
The _________ are fired by non-SQL events in the database.
Database event trigger
“Public” means that the package construct (variable, procedure, function, and so on) can be seen and executed from outside the package.
True
Package body contains only subprograms that are declared in the package specification.
False
Database triggers execute automatically whenever a data event such as DML or DDL occurs.
True
Which statement is used to enable a database trigger?
ALTER TRIGGER trigger_name enable
The conditional predicates are: _______, INSERTING, UPDATING.
DELETING
A ________ fires once for each row affected by the triggering DML statement, either just BEFORE the row is processed or just AFTER.
ROW TRIGGER
In creating trigger you need to consider the timing and event.
True
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
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
The ON DATABASE fires the trigger only for your own sessions.
False
DML Triggers can either be ON DATABASE or ON SCHEMA.
False
A ON SCHEMA fires the trigger for DDL on all schemas in the database.
False
A DML trigger may have more than one triggering event.
True
DML Trigger is classified in two ways: when they execute, how many times they execute.
True
A MUTE table is an object that is currently being modified by a DML statement.
False
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
To invoke package subprograms, fully ____the (public) subprogram with its PACKAGE NAME.
QUALIFY
Package specification is a container that enables you to group together related PL/SQL subprograms, variables, cursors, and exceptions.
False
A SYSTEM trigger execute automatically whenever a data event or a system event occurs.
False
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
You specify a row trigger using __________clause.
FOR EACH ROW
The given trigger header below 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
True
A row-level trigger must not query or modify a mutating table.
True
You cannot create a ______ trigger that refers to a specific database object.
DDL
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
In package specification, we declare constructs that will not be visible to the calling environment.
False
A DATA trigger execute automatically whenever a data event or a system event occurs.
False
Event determines which DML operation causes the trigger to fire. Values are INSERT, UPDATE [OF column], and DELETE.
True
The EXECUTE is a statement is used to invoke procedure in a trigger.
False
Since triggers are never explicitly invoked, they cannot receive parameters.
True
You can use triggers to generate derived column values _________.
AUTOMATICALLY
A DML trigger is a trigger that is automatically fired (executed) whenever an SQL DML statement (INSERT, UPDATE, or DELETE) is executed.
True
An ON DATABASE fires the trigger for ____ on all schemas in the database.
DDL
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
An ON DATABASE fires the trigger for ____ on all schemas in the database.
DDL
The conditional predicates are: _______, DELETING, UPDATING.
INSERTING