Creating Packages |
01. Which two programming constructs can be grouped within a package? (Choose two)
a. Cursor
b. Constant
c. Trigger
d. Sequence
e. View
Answer: A, B
02. Which statement concerning the trans_pkg package is true?
a. The check_stock private procedure must be declared within the body of the trans_pkg package.
b. The validate_trans public procedure must be defined within the specification of the trans_pkg package.
c. The validate_trans public procedure and the check_stock private procedure must both be defined within the body of the trans_pkg package.
d. The validate_trans public procedure and the check_stock private procedure must both be declared within the specification of the trans_pkg package.
Answer: C
03. 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 package chills can be shared with many applications.
e. You can achieve information hiding by making package constructs private.
Answer: D, E
04. Which two statements about packages are true? (Choose two)
a. Both specifications and body are required components of a package.
b. Package specification is optional but the package body is required.
c. A package specification is required but the package body is optional.
d. The specification and body of the package is stored together in a database.
e. The specification and body of the package are stored separately in the database.
Answer: C, D
05. In order for you to create run a package maintain_data which privilege do you need?
a. EXECUTE privilege on the maintain_data package.
b. INVOKE privilege on the maintain_data package.
c. EXECUTE privilege on the program units in the maintain_data package.
d. Object privilege on all of the objects that the maintain_data package is accessing.
e. Execute privilege on the program units inside the maintain_data package and execute privilege on the maintain_data package.
Answer: A
06. Which type of package construct must be declared both within the package specification and package body?
a. All package variables.
b. Boolean variables.
c. Private procedures and functions.
d. Public procedures and functions.
Answer: D
07. The add_player, upd_player_stat and upd_pitcher_stat procedures are grouped together in a package. A variable must be shared among only these procedures. Where should you declare this variable?
a. In the package body.
b. In the data base triggers.
c. In the procedures declare section using the exact name in each.
d. In the package specification.
Answer: A
08. Which two programming constructs can be grouped within a package? (Choose two)
A. Cursor
B. Constant
C. Trigger
D. Sequence
E. View
Answer: A, B
09. Which statement concerning the trans_pkg package is true?
A. The check_stock private procedure must be declared within the body of the trans_pkg package.
B. The validate_trans public procedure must be defined within the specification of the trans_pkg package.
C. The validate_trans public procedure and the check_stock private procedure must both be defined within the body of the trans_pkg package.
D. The validate_trans public procedure and the check_stock private procedure must both be declared within the specification of the trans_pkg package.
Answer: C
10. 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 package chills can be shared with many applications.
E. You can achieve information hiding by making package constructs private.
Answer: D, E
11. Which two statements about packages are true? (Choose two)
A. Both specifications and body are required components of a package.
B. Package specification is optional but the package body is required.
C. A package specification is required but the package body is optional.
D. The specification and body of the package is stored together in a database.
E. The specification and body of the package are stored separately in the database.
Answer: C, E
12. In order for you to create run a package maintain_data which privilege do you need?
A. EXECUTE privilege on the maintain_data package.
B. INVOKE privilege on the maintain_data package.
C. EXECUTE privilege on the program units in the maintain_data package.
D. Object privilege on all of the objects that the maintain_data package is accessing.
E. Execute privilege on the program units inside the maintain_data package and execute privilege on the maintain_data package.
Answer: A
13. Which type of package construct must be declared both within the package specification and package body?
A. All package variables.
B. Boolean variables.
C. Private procedures and functions.
D. Public procedures and functions.
Answer: D
14. The add_player, upd_player_stat and upd_pitcher_stat procedures are grouped together in a package.
A variable must be shared among only these procedures.
Where should you declare this variable?
A. In the package body.
B. In the data base triggers.
C. In the package specification.
D. In the procedures declare section using the exact name in each.
Answer: A
15. Which statement is true about nesting blocks?
A. Variable name must be unique between blocks.
B. A variable defined in the outer block is visible in the inner blocks.
C. A variable defined in the inner block is visible in the outer blocks.
D. A variable is in an inner block may have the same name as a variable in an outer block only if the data types are different.
Answer: B
16. Which command could be issued within a PL/SQL block?
A. GRANT
B. COMMIT
C. DROP TABLE
D. ALTER TABLE
Answer: B
# Examine the following piece of code: -
<<outer>>
DECLARE x
NUMBER : = 1;
y NUMBER : = 2;
z VARCHAR2(50) : = ‘CNS’;
BEGIN
<<inner>>
DECLARE
x NUMBER;
y NUMBER : = outer.y + 1;
z outer.z% TYPE : = ‘LIMITED’;
BEGIN
x : = x + 1;
y: = Y + 1;
Outer.z : = outer.z | | z;
dbms_output.put_line (x| |y| |z);
END inner;
dbms_output.put_line (x| |y| |z);
END outer;
17. What will the first output return (first underlined statement)?
A. 4LIMITED
B. 24LIMITED
C. 12CNSLIMITED
D. 24CNSLIMITED
Answer: A
18. What will the second output return (second Underlined statement)?
A. 12LIMITED
B. 24LIMITED
C. 12CNSLIMITED
D. 2CNSLIMITED
Answer: C
0 Comments