Sunteți pe pagina 1din 6

Test: Section 9 Quiz

Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.

Section 9 Quiz
(Answer all questions in this section)

1. When a database object is first created, only its owner (creator)


and the Database Administrator are privileged to use it. True or False? Mark
for Review
(1) Points

True (*)

False

Correct Correct

2. JOE's schema contains a COUNTRIES table. The following commands


are executed by JOE and TOM:
(JOE): GRANT SELECT ON countries TO tom WITH GRANT OPTION;
(TOM): GRANT SELECT on joe.countries TO dick WITH GRANT OPTION;
Now, JOE executes:
REVOKE SELECT ON countries FROM tom;
What happens to the grant to DICK?

Mark for Review


(1) Points

The REVOKE statement fails because only the Database Administrator (not JOE)
can revoke privileges.

The REVOKE statement fails because JOE must remove the SELECT privilege from
both users at the same time.

Nothing. DICK's privilege is preserved even though TOM lost his privilege.

DICK also loses his SELECT privilege. (*)

Incorrect Incorrect. Refer to Section 9 Lesson 5.

3. A benefit of user-defined functions is that the function can


accept any SQL or PL/SQL data type. True or False? Mark for Review
(1) Points
True

False (*)

Incorrect Incorrect. Refer to Section 9 Lesson 2.

4. You want to create a function which can be used in a SQL


statement. Which one of the following can be coded within your function? Mark
for Review
(1) Points

RETURN BOOLEAN

COMMIT;

An OUT parameter

One or more IN parameters (*)

Correct Correct

5. Which of the following is a legal location for a function call in


a SQL statement? (Choose 3) Mark for Review
(1) Points

(Choose all correct answers)

CREATE TABLE statement

The ORDER BY and GROUP BY clauses of a query (*)

VALUES clause of an INSERT statement (*)

WHERE clause in a DELETE statement (*)

Correct Correct

Page 1 of 3 Next Summary


Test: Section 9 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.

Section 9 Quiz
(Answer all questions in this section)

6. Which Data Dictionary view can be used to display the detailed


code of a procedure in your schema? Mark for Review
(1) Points

USER_SOURCE (*)

USER_OBJECTS

None of these

USER_SUBPROGRAMS

USER_PROCEDURES

Correct Correct

7. The following code shows the dependencies between three


procedures:
CREATE PROCEDURE parent
IS BEGIN
child1;
child2;
END parent;
You now try to execute:

DROP PROCEDURE child2;


What happens?

Mark for Review


(1) Points

The database automatically drops CHILD1 as well.

CHILD2 is dropped successfully. PARENT is marked INVALID, but CHILD1 is still


valid. (*)

CHILD2 is dropped successfully. PARENT and CHILD1 are both marked INVALID.

The database automatically drops PARENT as well.


You cannot drop CHILD2 because PARENT is dependent on it.

Correct Correct

8. User SALLY's schema contains a NEWEMP table. Sally uses Invoker's


rights to create procedure GET_NEWEMP which includes the line:
SELECT ... FROM NEWEMP ... ;

Sally also grants EXECUTE privilege on the procedure to CURLY, but no other
privileges. What will happen when Curly executes the procedure?

Mark for Review


(1) Points

The procedure will fail because Curly does not have the EXECUTE ANY PROCEDURE
system privilege.

The procedure will execute successfully.

The procedure will fail because Curly does not have SELECT privilege on
NEWEMP.

The procedure will fail because there is no NEWEMP table in Curly's schema.
(*)

Correct Correct

9. User BOB creates procedure MYPROC using the default Definer's


Rights. BOB then executes:
GRANT EXECUTE ON bob.myproc TO ted;
When TED invokes BOB.MYPROC, whose privileges are checked? Mark for Review
(1) Points

Test: Section 9 Quiz


Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.

Section 9 Quiz
(Answer all questions in this section)

11. A user executes the following statement:


CREATE INDEX fn_index ON employees(first_name);

What output will the following statement now display:

SELECT index_name
FROM user_indexes
WHERE index_name LIKE 'fn%';
Mark for Review
(1) Points

fn_index

FN_INDEX

fn_index FN_INDEX

No output will be displayed (*)

Correct Correct

12. You want to see the names of all the columns in a table in your
schema. You want to query the Dictionary instead of using the DESCRIBE command.
Which Dictionary view should you query? Mark for Review
(1) Points

USER_OBJECTS

USER_TABLES

USER_COLUMNS

USER_TAB_COLS (*)

Incorrect Incorrect. Refer to Section 9 Lesson 3.

13. Which of the following is a difference between a procedure and a


function? Mark for Review
(1) Points

A function cannot be used within a SQL statement; a procedure can be used


within SQL.

A function must return a value; a procedure may or may not. (*)

An explicit cursor can be declared in a procedure, but not in a function.


A procedure can have default values for parameters, while a function cannot.

Functions cannot be nested; procedures can be nested to at least 8 levels.

Correct Correct

14. You have created a function called GET_COUNTRY_NAME which accepts


a country_id as an IN parameter and returns the name of the country. Which one of
the following calls to the function will NOT work? Mark for Review
(1) Points

SELECT get_country_name(100) FROM dual;

DBMS_OUTPUT.PUT_LINE(get_country_name(100));

BEGIN get_country_name(100, v_name); END; (*)

v_name := get_country_name(100);

Correct Correct

15. A stored function: Mark for Review


(1) Points

is called as a standalone executable statement.

must return one and only one value. (*)

must have at least one IN parameter.

cannot be called in a SQL statement.

Correct Correct

Previous Page 3 of 3 Summary

S-ar putea să vă placă și