Академический Документы
Профессиональный Документы
Культура Документы
True or F
alse? TYPE DeptRecTyp IS RECORD (deptid NUMBER(4) NOT NULL := 99, dname departme
nts.department_name%TYPE, loc departments.location_id%TYPE, region regions%ROWTY
PE ); dept_rec DeptRecTyp; (1) Points True (*) False
Incorrect. Refer to Section 10 Lesson 3. 2. What is the correct format to declar
e a variable using the following emp_pkg package composite data type? TYPE empre
c_type IS TABLE OF employees%ROWTYPE INDEX BY BINARY_INTEGER; (1) Points emp_pkg
.emprec_type; emprec_type.emp_pkg; v_emp_table emprec_type.emp_pkg; v_emp_table
emp_pkg.emprec_type; (*) None of the above
Incorrect. Refer to Section 10 Lesson 3. 3. ckage? (Choose three) Which of the f
ollowing are not allowed in a bodiless pa (1) Points (Choose all correct answers
) Subprograms (*) Global variables Private variables (*)
Correct 7. (1) Points Procedures Explicit cursors Triggers (*) Functions Global
variables Which one of the following can NOT be part of a Package
?
Incorrect. Refer to Section 10 Lesson 1. 8. Which of the following are good reas
ons for creating an d using Packages? Related procedures, functions and variable
s can be grouped together as a single unit We can recompile the package body wit
hout having to recompile the specification We can create packages without needin
g any system privileges We can declare INDEX BY tables and use them as parameter
s (1) Points A and B A, B and C A and C A, B and D (*) A, B, C and D
Incorrect. Refer to Section 10 Lesson 1. 9. true ? (1) Points Which of the follo
wing statements about packages is NOT
All procedures and functions must be declared in the specification. (*) Cursors
can be declared in the specification. The body contains the detailed code of the
subprograms. Variables can be declared in the body. The specification must be c
reated before the body.
Incorrect. Refer to Section 10 Lesson 1. 10. Package OLDPACK is in your schema.
What will happen whe n the following statement is executed? DROP PACKAGE oldpack
; (1) Points The body will be dropped but the specification will be retained. Th
e specification will be dropped but the body will be retained. Both the specific
ation and the body will be dropped. (*) The statement will fail because you must
drop the body before you can dr op the specification.
Correct Section 10 11. Package NEWPACK contains several procedures and functio n
s, including private function PRIVFUNC. From where can PRIVFUNC be invoked? (Ch
oose two.) (1) Points (Choose all correct answers) From an anonymous block From
any procedure in NEWPACK (*) From any private function in another package
From any function in NEWPACK (*) From any public procedure in another package
Incorrect. Refer to Section 10 Lesson 2. 12. In a package, public components are
declared in the spe cification but private components are not. True or False? (
1) Points True (*) False
Correct 13. We need to declare a package variable named MYVAR, whic h can be ref
erenced by any subprogram in the package but can NOT be referenced f rom outside
the package. In the following code, where should MYVAR be declared? CREATE OR R
EPLACE PACKAGE varpack IS -- Point A ... END varpack; CREATE OR REPLACE PACKAGE
BODY varpack IS -- Point B PROCEDURE varproc IS -- Point C BEGIN ... END varproc
; PROCEDURE ... ... -- Point D END varpack; (1) Points Point A Point B (*) Point
C Point D Point B or Point C, they will both work
Incorrect. Refer to Section 10 Lesson 2. 14. Your schema contains four packages,
each having a speci fication and a body. You have also been granted privileges
to access three packa ges (and their bodies) in other users' schemas. What will
be displayed by the fo llowing query? SELECT COUNT(*) FROM ALL_OBJECTS WHERE obj
ect_type LIKE 'PACK%' AND owner <> USER; (1) Points 14 7 3 6 (*) 0
Incorrect. Refer to Section 10 Lesson 2.
Section 11 15. The UTL_FILE package can be used to create binary files such as J
PEGs as well as text files. True or False? (1) Points True False (*)
Incorrect. Refer to Section 11 Lesson 2. 16. Which of the following exceptions c
an be raised ONLY whe n using the UTL_FILE package? (Choose two). (1) Points (Ch
oose all correct answers) INVALID_PATH (*)
Dick: 45, Hazel: 45 Dick: 45, Hazel: 0 Dick: 45, Hazel: null (*) Dick: 0, Hazel:
0 Both queries will fail because the syntax of DBMS_OUTPUT.PUT_LINE is inc orre
ct
Incorrect. Refer to Section 11 Lesson 1. Section 12 21. ts (Choose all correct a
nswers) Provide the ability to execute SQL statements whose structure is unknown
until execution time. (*) Provide the ability to handle mutating rows when exec
uting a statement i nvolving the same table. Allow fetch of data for DML stateme
nts. Enables session-control statements to be written and executed from PL/SQ L.
(*) Name two reasons for using Dynamic SQL. (1) Poin
Incorrect. Refer to Section 12 Lesson 1. 22. A public packaged procedure contain
s the following SQL statement: UPDATE employees SET salary = salary * 1.1; When
is this SQL statement parsed? (1) Points When the package specification is creat
ed When the package body is created (*) When the package header is loaded into m
emory.
When the package is loaded into memory. Only the first time the procedure is exe
cuted.
Incorrect. Refer to Section 12 Lesson 1. 23. You want to create a function which
drops a table. You write the following code: CREATE OR REPLACE FUNCTION droptab
(p_tab_name IN VARCHAR2) RETURN BOOLEAN IS BEGIN DROP TABLE p_tab_name; RETURN
TRUE; EXCEPTION WHEN OTHERS THEN RETURN FALSE; END; Why will this procedure not
compile successfully? (1) Points Because you can never drop a table from inside
a function Because the PL/SQL compiler cannot check if the argument of p_tab_nam
e i s a valid table-name (*) Because you do not have the privilege needed to dro
p a table Because you cannot use RETURN in the exception section
Incorrect. Refer to Section 12 Lesson 1. 24. A SQL statement can pass through se
veral stages. Which of the following is NOT one of these stages? (1) Points BIND
FETCH PARSE RETURN (*)
EXECUTE
Incorrect. Refer to Section 12 Lesson 1. 25. All but which of the following are
benefits of using th e NOCOPY hint? (Choose two) (1) Points (Choose all correct
answers) Safer because it uses passing by value. (*) Efficient since it uses les
s memory. Uses a larger block of server memory for faster access. (*) Faster bec
ause a single copy of the data is used. Eliminates extra processing.
Incorrect. Refer to Section 12 Lesson 2. 26. Where would you place the BULK COLL
ECT statement in the following example? DECLARE TYPE DeptRecTab IS TABLE OF depa
rtments%ROWTYPE; dept_recs DeptRecTab; CURSOR c1 IS SELECT department_id, depart
ment_name, manager_id, location_id -- Position A FROM departments WHERE departme
nt_id > 70; BEGIN OPEN c1 -- Position B; FETCH c1 -- Position C INTO dept_recs;
END; (1) Points Position A Position B
Position C (*)
Incorrect. Refer to Section 12 Lesson 2. 27. To create a list of the top 20 movi
es from a catalog of millions of titles, the following statement grabs those row
s using a collection. True or False? ... TYPE nametab IS TABLE OF movies.title%T
YPE; Title_tab nametab; ... SELECT title BULK COLLECT INTO title_tab FROM movies
ORDER BY rental_count DESC; ... (1) Points True (*) False
Incorrect. Refer to Section 12 Lesson 2. 28. (1) Points True (*) False FORALL ca
n be used with any DML statement. True or Fals
e?
Correct
Section 13 29. igger? (1) Points What is the purpose of using the CALL statement
in a tr
It allows an INSTEAD OF trigger to be a statement trigger. It allows the trigger
body code to be placed in a separate procedure. (* )
Incorrect. Refer to Section 13 Lesson 4. 32. Examine this code: CREATE TRIGGER n
ew_trigg AFTER CREATE ON reserved_word BEGIN ... Which of the following can be u
sed in place of reserved_word? (Choose two.) (1) Points (Choose all correct answ
ers) TABLE SCHEMA (*) USER DATABASE (*) TABLE employees
Incorrect. Refer to Section 13 Lesson 4. 33. What is the event that will cause t
he trigger on the em p_details view below to fire? CREATE OR REPLACE TRIGGER new
_emp_dept INSTEAD OF INSERT ON emp_details BEGIN INSERT INTO new_emps VALUES (:N
EW.employee_id, :NEW.last_name, :NEW.salary, :NEW.department_id); new_depts SET
dept_sal = dept_sal + :NEW.salary WHERE department_id = :NEW.department_id; END;
(1) Points An attempt to update salary column on the new_depts table A new empl
oyee is added to the emp_details table A procedure calls the new_emp_dept trigge
r.
An attempt to add a row in the emp_details view (*) An attempt to add a row in t
he new_depts table.
Incorrect. Refer to Section 13 Lesson 3. 34. Examine the following code. To crea
te a row trigger, wh at code should be included at Line A? CREATE TRIGGER dept_t
rigg AFTER UPDATE OR DELETE ON departments -- Line A BEGIN ... (1) Points AFTER
EACH ROW FOR EVERY ROW FOR EACH ROW (*) ON EACH ROW ON EVERY ROW
Incorrect. Refer to Section 13 Lesson 3. 35. In the following code: CREATE TRIGG
ER mytrigg INSTEAD OF INSERT OR UPDATE ON my_object_name FOR EACH ROW BEGIN ...
my_object_name can be the name of a table. True or False? (1) Points True False
(*)
Incorrect. Refer to Section 13 Lesson 3. 36. ound trigger? What is wrong with th
e following code example for a comp
False
Correct 39. A business rule states that an employee's salary cannot be greater t
han 99,999.99 or less than 0. The best way to enforce this rule is by using: (1)
Points A datatype of NUMBER(7,2) for the SALARY column A database trigger A che
ck constraint (*) An application trigger A view
Incorrect. Refer to Section 13 Lesson 1. 40. se? (Choose two.) Which of the foll
owing are NOT stored inside the databa (1) Points (Choose all correct answers) A
PL/SQL package specification A database trigger An anonymous block (*) An appli
cation trigger (*) A sequence
Incorrect. Refer to Section 13 Lesson 1. Section 13 41. Which of the following a
re good guidelines to follow wh en creating a database trigger? (Choose two.) (1
) Points (Choose all correct answers)
Where possible, use a trigger to enforce a foreign key constraint. Use triggers
to override privilege checking and view other users' privat e tables. Do not use
a trigger to replace or duplicate something which the Oracle Server does automa
tically. (*) Use triggers to prevent unauthorized users from SELECTing confident
ial d ata. Do not create a trigger that automatically fires another trigger. (*)
Incorrect. Refer to Section 13 Lesson 1. 42. What type of database object would
you create to write an auditing record automatically every time a user connects
to the database? (1) Points A procedure A complex view A trigger (*) A function
A package
Incorrect. Refer to Section 13 Lesson 1. 43. (1) Points Which of the following b
est describes a database trigge
r?
A subprogram that checks whether a user has typed the correct password t o log o
n to the database. A PL/SQL subprogram that executes automatically whenever an a
ssociated d atabase event occurs. (*)
A PL/SQL subprogram that always returns exactly one value. A subprogram that is
invoked explicitly by the calling application. A PL/SQL subprogram that inserts
rows into a logging table.
Correct 44. What is wrong with the following code? CREATE TRIGGER dept_trigg BEF
ORE UPDATE OF department_name ON departments BEGIN DBMS_OUTPUT.PUT_LINE(:NEW.dep
artment_name); END; (1) Points You cannot use :NEW in a BEFORE trigger, only in
an AFTER trigger. You cannot use :NEW or :OLD in a statement trigger. (*) You ca
nnot use DBMS_OUTPUT.PUT_LINE inside a trigger. The second line should be: BEFOR
E UPDATE ON departments.department_name
Incorrect. Refer to Section 13 Lesson 2. 45. What is wrong with the following co
de? CREATE OR REPLACE TRIGGER loc_trigg BEFORE DELETE ON locations BEGIN RAISE_A
PPLICATION_ERROR(-20201,'Invalid delete'); ROLLBACK; END; (1) Points The last li
ne should be: END loc_trigg; You cannot use RAISE_APPLICATION_ERROR inside a tri
gger. The second line should be: BEFORE DELETE OF locations
ld you use?
(1) Points
ALTER TABLE departments DISABLE ALL TRIGGERS; (*) ALTER TRIGGER DISABLE ALL ON d
epartments; ALTER TABLE departments DISABLE TRIGGERS; DISABLE ALL TRIGGERS ON de
partments; ALTER TABLE departments DROP ALL TRIGGERS;
Incorrect. Refer to Section 13 Lesson 5. 49. User AYSEGUL successfully creates t
he following trigger : CREATE TRIGGER loc_trigg BEFORE UPDATE ON aysegul.locatio
ns BEGIN .... AYSEGUL now tries to drop the LOCATIONS table. What happens? (1) P
oints An error message is displayed because you cannot drop a table that is as s
ociated with a trigger. The table is dropped and the trigger is disabled. The tr
igger is dropped but the table is not dropped. Both the table and the trigger ar
e dropped. (*) None of the above.
Incorrect. Refer to Section 13 Lesson 5. 50. Which of the following will remove
a trigger in your sc hema named EMP_TRIGG from the database? (1) Points DROP emp
_trigg TRIGGER;
ALTER TRIGGER emp_trigg DISABLE; DROP TRIGGER emp_trigg; (*) REMOVE TRIGGER emp_
trigg; None of the above
Incorrect. Refer to Section 13 Lesson 5.