Database Programming With SQL Section 17 Quiz

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Database Programming with SQL-Section 17 Quiz

Section 17 Quiz
(Answer all questions in this section)
1. User Kate wants to create indexes on tables in her schema. What privilege must be granted to Kate so
that she can do this? Mark for Review
(1) Points
CREATE INDEX
CREATE ANY INDEX
ALTER TABLE
None; users do not need extra privileges to create indexes on tables in their own schema. (*)
Correct Correct
2. Which of the following privileges must be assigned to a user account in order for that user to connect to
an Oracle database? Mark for Review
(1) Points
ALTER SESSION
OPEN SESSION
RESTRICTED SESSION
CREATE SESSION (*)
Correct Correct
3. What system privilege must be held in order to login to an Oracle database? Mark for Review
(1) Points
CREATE LOGIN
CREATE SESSION (*)
CREATE LOGON
No special privilege is needed; if your username exists in the database, you can login.
Correct Correct
4. The following table shows some of the output from one of the data dictionary views. Which view is
being queried?
USERNAME PRIVILEGE ADMIN_OPTION
USCA_ORACLE_SQL01_S08 CREATE VIEW NO
USCA_ORACLE_SQL01_S08 CREATE TABLE NO
USCA_ORACLE_SQL01_S08 CREATE SYNONYM NO
USCA_ORACLE_SQL01_S08 CREATE TRIGGER NO
USCA_ORACLE_SQL01_S08 CREATE SEQUENCE NO
USCA_ORACLE_SQL01_S08 CREATE DATABASE NO
Mark for Review
(1) Points
role_tab_privs (lists table privileges granted to roles)
user_tab_privs_recd (lists object privileges granted to the user)
user_sys_privs (lists system privileges granted to the user) (*)
role_sys_privs (lists system privileges granted to roles)
Correct Correct
5. Which of the following best describes a role in an Oracle database? Mark for Review
(1) Points
A role is the part that a user plays in querying the database.
A role is a type of system privilege.
A role is an object privilege which allows a user to update a table.
A role is a name for a group of privileges. (*)
Correct Correct
===============
Section 17 Quiz
(Answer all questions in this section)
6. By Controlling User Access with Oracle Database Security, you can give access to specific Objects in
the Database. True or False? Mark for Review
(1) Points
True (*)
False
Incorrect Incorrect. Refer to Section 17 Lesson 1.
7. REGULAR EXPRESSIONS can be used on CHAR, CLOB, and VARCHAR2 datatypes? (True or
False) Mark for Review
(1) Points
True (*)
False
Correct Correct
8. Parentheses are not used to identify the sub expressions within the expression. True or False? Mark for
Review
(1) Points
True
False (*)
Correct Correct
9. Select the correct REGULAR EXPRESSION functions: (Choose two) Mark for Review
(1) Points
(Choose all correct answers)
REGEXP_REPLACE, REGEXP_REFORM
REGEXP_LIKE, REGEXP_NEAR
REGEXP_LIKE, REGEXP_REPLACE (*)
REGEXP_INSTR, REGEXP_SUBSTR (*)
Correct Correct
10. Roles are: Mark for Review
(1) Points
Required to manipulate the content of objects in the database.
A collection of objects, such as tables, views, and sequences.
Required to gain access to the database.
Named groups of related privileges given to a user or another role. (*)
Incorrect Incorrect. Refer to Section 17 Lesson 2.
============
Section 17 Quiz
(Answer all questions in this section)
11. User BOB’s schema contains an EMPLOYEES table. BOB executes the following statement:
GRANT SELECT ON employees TO mary WITH GRANT OPTION;
Which of the following statements can MARY now execute successfully? (Choose two)
Mark for Review
(1) Points
(Choose all correct answers)
REVOKE SELECT ON bob.employees FROM bob;
GRANT SELECT ON bob.employees TO PUBLIC; (*)
SELECT FROM bob.employees; (*)
DROP TABLE bob.employees;
Correct Correct
12. Which statement would you use to remove an object privilege granted to a user? Mark for Review
(1) Points
DROP
REMOVE
ALTER USER
REVOKE (*)
Correct Correct
13. When a user is logged into one database, he is restricted to working with objects found in that
database. True or False? Mark for Review
(1) Points
True
False (*)
Correct Correct
14. User CRAIG creates a view named INVENTORY_V, which is based on the INVENTORY table.
CRAIG wants to make this view available for querying to all database users. Which of the following
actions should CRAIG perform? Mark for Review
(1) Points
He should assign the SELECT privilege to all database users for the INVENTORY table.
He must grant each user the SELECT privilege on both the INVENTORY table and INVENTORY_V
view.
He should assign the SELECT privilege to all database users for INVENTORY_V view. (*)
He is not required to take any action because, by default, all database users can automatically access
views.
Correct Correct
15. To take away a privilege from a user, you use which command? Mark for Review
(1) Points
DELETE
REVOKE (*)
REMOVE
ALTER
Correct Correct

You might also like