1.Which two statements about packages are true? (Choose two.)
A.Packages can be nested.
B.You can pass parameters to packages.
C.A package is loaded into memory each time it is invoked.
D.The contents of packages can be shared by many applications.
E.You can achieve information hiding by making package constructs private.
Correct:D E
1z0-101:develop pl/sql program units
2.Which code can you use to ensure that the salary is neither increased by more than 10% at a time nor is it ever decreased?
A.ALTER TABLE emp ADD CONSTRAINT ck_sal CHECK (sal BETWEEN sal AND sal*1.1);
B.CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp FOR EACH ROW WHEN (new.sal < old.sal OR new.sal > old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary nor increase by more than 10%'); END;
C.CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp WHEN (new.sal < old.sal OR new.sal > old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary nor increase by more than 10%'); END;
D.CREATE OR REPLACE TRIGGER check_sal AFTER UPDATE OF sal ON emp WHEN (new.sal < old.sal OR -new.sal > old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary nor increase by more than 10%'); END;
Correct:B
3.The procedure ADD_PRODUCT is defined within a package specification as follows: PROCEDURE ADD_PRODUCT (p_prodno NUMBER, p_prodname VARCHAR2); Which procedure declaration cannot be added to the package specification?
A.PROCEDURE add_product (p_order_date DATE);
B.PROCEDURE add_product (p_name VARCHAR2, p_ordered DATE);
C.PROCEDURE add_product (p_prodname VARCHAR2, p_price NUMBER);
D.PROCEDURE add_product (p_price NUMBER, p_description VARCHAR2);
Correct:D
4.The programmer who developed a procedure ACCOUNT_TRANSACTION left the organization. You are assigned the task of modifying this procedure. You want to find all the program units invoking the ACCOUNT_TRANSACTION procedure. How can you find this information?
A.Query the USER_SOURCE data dictionary view.
B.Query the USER_PROCEDURES data dictionary view.
C.Query the USER_DEPENDENCIES data dictionary view.
D.Set the SQL*Plus environment variable TRACECODE=TRUE and run the ACCOUNT_TRANSACTION procedure.
E.Set the SQL*Plus environment variable DEPENDENCIES=TRUE and run the ACCOUNT_TRANSACTION procedure.
Correct:C
5.Which part of a database trigger determines the number of times the trigger body executes?
A.trigger type
B.trigger body
C.trigger event
D.trigger timing
Correct:A