Database Programming With SQL Section 17 Quiz Part II
Database Programming With SQL Section 17 Quiz Part II
Section 17 Quiz
(Answer all questions in this section)
1. REGULAR EXPRESSIONS can be used as part of a contraint definition. (True or False?) Mark for
Review
(1) Points
True (*)
False
Correct Correct
2. Select the correct REGULAR EXPRESSION functions: (Choose two) Mark for Review
(1) Points
REGEXP_LIKE, REGEXP_NEAR
Correct Correct
3. REGULAR EXPRESSIONS can be used on CHAR, CLOB, and VARCHAR2 datatypes? (True or
False) Mark for Review
(1) Points
True (*)
False
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
5. User CHANG has been granted SELECT, UPDATE, INSERT, and DELETE privileges on the
EMPLOYEES table. You now want to prevent Chang from adding or deleting rows from the table, while
still allowing him to read and modify existing rows. Which statement should you use to do this? Mark for
Review
(1) Points
Section 17 Quiz
(Answer all questions in this section)
6. User ADAM has successfully logged on to the database in the past, but today he receives an error
message stating that (although he has entered his password correctly) he cannot log on. What is the most
likely cause of the problem? Mark for Review
(1) Points
7. 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
ALTER TABLE
None; users do not need extra privileges to create indexes on tables in their own schema. (*)
Correct Correct
8. Which of these is NOT a System Privilege granted by the DBA? Mark for Review
(1) Points
Create Session
Create Procedure
Create Sequence
Correct Correct
9. 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
Correct Correct
10. Which of the following simplifies the administration of privileges? Mark for Review
(1) Points
A trigger
A view
A role (*)
An index
Section 17 Quiz
(Answer all questions in this section)
Database Links allow users to work on remote database objects without having to log into the other
database. (*)
Database Links can be created by any user of a database. You do not need any special privileges to create
them.
12. Which data dictionary view shows which system privileges have been granted to a user? Mark for
Review
(1) Points
USER_SYSTEM_PRIVS
USER_SYSTEM_PRIVILEGES
USER_TAB_PRIVS
USER_SYS_PRIVS (*)
13. A role can be granted to another role. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
14. Scott King owns a table called employees. He issues the following statement:
GRANT select ON employees TO PUBLIC;
Allison Plumb has been granted CREATE SESSION by the DBA. She logs into the database and issues
the following statement:
GRANT ᅠselect ON ᅠscott_king.employees TO jennifer_cho;
True (*)
False
Correct Correct
15. You need to grant user BOB SELECT privileges on the EMPLOYEES table. You want to allow
BOB to grant this privileges to other users. Which statement should you use? Mark for Review
(1) Points
Section 17 Quiz
(Answer all questions in this section)
1. 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
Correct Correct
2. Regular expressions used as check constraints are another way to ensure data is formatted correctly
prior to being written into the database table. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
3. REGULAR EXPRESSIONS can be used as part of a contraint definition. (True or False?) Mark for
Review
(1) Points
True (*)
False
Correct Correct
4. Granting an object privilege WITH GRANT OPTION allows the recipient to grant all object
privileges on the table to other users. True or False? Mark for Review
(1) Points
True
False (*)
5. A role can be granted to another role. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
6. Which statement would you use to remove an object privilege granted to a user? Mark for Review
(1) Points
ALTER USER
DROP
REVOKE (*)
REMOVE
Incorrect Incorrect. Refer to Section 17 Lesson 2.
7. Which of the following statements about granting object privileges is false? Mark for Review
(1) Points
The owner of an object automatically acquires all object privileges on that object.
An object owner can grant any object privilege on the object to any other user or role of the database.
To grant privileges on an object, the object must be in your own schema, or you must have been granted
the object privileges WITH GRANT OPTION.
8. Which of the following best describes the purpose of the REFERENCES object privilege on a table?
Mark for Review
(1) Points
It allows the user to create new tables which contain the same data as the referenced table.
It allows a user's session to read from the table but only so that foreign key constraints can be checked.
9. User1 owns a table and grants select on it WITH GRANT OPTION to User2. User2 then grants
select on the same table to User3. If User1 revokes select privileges from User2, will User3 be able to
access the table? Mark for Review
(1) Points
Yes
No (*)
10. 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
OPEN SESSION
RESTRICTED SESSION
ALTER SESSION
Section 17 Quiz
(Answer all questions in this section)
11. Which of the following Object Privileges can be granted on an individual column on a table?
(Choose two) Mark for Review
(1) Points
References (*)
Update (*)
Delete
Select
Correct Correct
12. Which of the following is NOT a database object? Mark for Review
(1) Points
Table
Sequence
View
Subquery (*)
13. Which of the following best describes a role in an Oracle database? Mark for Review
(1) Points
14. User JAMES has created a CUSTOMERS table and wants to allow all other users to SELECT from
it. Which command should JAMES use to do this? Mark for Review
(1) Points
15. Which Object Privilege (other than Alter) can be granted to a Sequence? Mark for Review
(1) Points
SELECT (*)
INSERT
DELETE
UPDATE
INDEX
UPDATE
2. You grant user AMY the CREATE SESSION privilege. Which type of privilege have you granted to
AMY? Mark for Review
(1) Points
A user privilege
An object privilege
An access privilege
Correct Correct
5. User SUSAN creates an EMPLOYEES table, and then creates a view EMP_VIEW which shows only
the FIRST_NAME and LAST_NAME columns of EMPLOYEES. User RUDI needs to be able to access
employees' names but no other data from EMPLOYEES. Which statement should SUSAN execute to
allow this? Mark for Review
(1) Points
Section 17 Quiz
(Answer all questions in this section)
6. You are the database administrator. You want to create a new user JONES with a password of
MARK, and allow this user to create his own tables. Which of the following should you execute? Mark
for Review
(1) Points
Correct Correct
7. Which of the following statements is true? Mark for Review
(1) Points
Database Links allow users to work on remote database objects without having to log into the other
database. (*)
Database Links can be created by any user of a database. You do not need any special privileges to create
them.
Correct Correct
8. If you are granted privileges to your friend's object, by default you may also grant access to this same
object to other users. True or False? Mark for Review
(1) Points
True
False (*)
9. When granting an object privilege, which option would you include to allow the grantee to grant the
privilege to another user? Mark for Review
(1) Points
FORCE
Correct Correct
10. You need to grant user BOB SELECT privileges on the EMPLOYEES table. You want to allow
BOB to grant this privileges to other users. Which statement should you use? Mark for Review
(1) Points
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
11. To take away a privilege from a user, you use which command? Mark for Review
(1) Points
DELETE
REMOVE
REVOKE (*)
ALTER
Incorrect Incorrect. Refer to Section 17 Lesson 2.
12. User1 owns a table and grants select on it WITH GRANT OPTION to User2. User2 then grants
select on the same table to User3. If User1 revokes select privileges from User2, will User3 be able to
access the table? Mark for Review
(1) Points
No (*)
Yes
Correct Correct
13. Regular expressions are a method of describing both simple and complex patterns for searching and
manipulating. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
14. _________________ are special characters that have a special meaning, such as a wildcard
character, a repeating character, a non-matching character, or a range of characters. You can use several
of these symbols in pattern matching. Mark for Review
(1) Points
Alphanumeric values
Reference checks
Clip Art
Correct Correct
15. REGULAR EXPRESSIONS can be used as part of a contraint definition. (True or False?) Mark for
Review
(1) Points
True (*)
False
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
1. Which statement would you use to remove an object privilege granted to a user? Mark for Review
(1) Points
REVOKE (*)
REMOVE
ALTER USER
DROP
Correct Correct
2. What Oracle feature simplifies the process of granting and revoking privileges? Mark for Review
(1) Points
Object
Schema
Role (*)
Data dictionary
3. Which statement would you use to grant a role to users? Mark for Review
(1) Points
GRANT (*)
CREATE USER
ALTER USER
ASSIGN
4. 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)
5. Which of the following simplifies the administration of privileges? Mark for Review
(1) Points
A view
A role (*)
An index
A trigger
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
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. REGULAR EXPRESSIONS does exactly the same as LIKE--no more and no less. (True or False?)
Mark for Review
(1) Points
True
False (*)
9. Select the correct REGULAR EXPRESSION functions: (Choose two) Mark for Review
(1) Points
REGEXP_LIKE, REGEXP_NEAR
REGEXP_REPLACE, REGEXP_REFORM
Correct Correct
10. What system privilege must be held in order to login to an Oracle database? Mark for Review
(1) Points
CREATE LOGIN
CREATE LOGON
No special privilege is needed; if your username exists in the database, you can login.
Section 17 Quiz
(Answer all questions in this section)
11. User ADAM has successfully logged on to the database in the past, but today he receives an error
message stating that (although he has entered his password correctly) he cannot log on. What is the most
likely cause of the problem? Mark for Review
(1) Points
ADAM's user account has been removed from the database.
Correct Correct
INDEX
UPDATE
Correct Correct
13. 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
RESTRICTED SESSION
ALTER SESSION
OPEN SESSION
Correct Correct
14. Which of the following Object Privileges can be granted on an individual column on a table?
(Choose two) Mark for Review
(1) Points
Delete
Select
References (*)
Update (*)
Correct Correct
15. Which Object Privilege (other than Alter) can be granted to a Sequence? Mark for Review
(1) Points
DELETE
UPDATE
SELECT (*)
INSERT
Correct Correct
Previous Page 3 of 3 Summary
Section 17 Quiz
(Answer all questions in this section)
1. You create a view named EMPLOYEES_VIEW on a subset of the EMPLOYEES table. User
AUDREY needs to use this view to create reports. Only you and Audrey should have access to this view.
Which of the following actions should you perform? Mark for Review
(1) Points
Do nothing. As a database user, Audrey's user account has automatically been granted the SELECT
privilege for all database objects.
2. What system privilege must be held in order to login to an Oracle database? Mark for Review
(1) Points
CREATE LOGIN
CREATE LOGON
No special privilege is needed; if your username exists in the database, you can login.
Delete
References (*)
Select
Update (*)
Correct Correct
Sequence
Subquery (*)
View
Table
Correct Correct
5. Which of these is NOT a System Privilege granted by the DBA? Mark for Review
(1) Points
Create Procedure
Create Session
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
6. Which Object Privilege (other than Alter) can be granted to a Sequence? Mark for Review
(1) Points
SELECT (*)
DELETE
INSERT
UPDATE
Correct Correct
7. Which of the following best describes the purpose of the REFERENCES object privilege on a table?
Mark for Review
(1) Points
It allows the user to create new tables which contain the same data as the referenced table.
It allows a user to create foreign key constraints on the table. (*)
It allows a user's session to read from the table but only so that foreign key constraints can be checked.
Correct Correct
8. User1 owns a table and grants select on it WITH GRANT OPTION to User2. User2 then grants
select on the same table to User3. If User1 revokes select privileges from User2, will User3 be able to
access the table? Mark for Review
(1) Points
Yes
No (*)
Correct Correct
9. Scott King owns a table called employees. He issues the following statement:
GRANT select ON employees TO PUBLIC;
Allison Plumb has been granted CREATE SESSION by the DBA. She logs into the database and issues
the following statement:
GRANT ᅠselect ON ᅠscott_king.employees TO jennifer_cho;
True (*)
False
Correct Correct
10. Which of the following simplifies the administration of privileges? Mark for Review
(1) Points
A role (*)
An index
A trigger
A view
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
11. To join a table in your database to a table on a second (remote) Oracle database, you need to use:
Mark for Review
(1) Points
An ODBC driver
True
False (*)
Correct Correct
13. Which of these SQL functions used to manipulate strings is NOT a valid regular expression function
? Mark for Review
(1) Points
REGEXP_SUBSTR
REGEXP_LIKE
REGEXP_REPLACE
REGEXP (*)
14. Regular expressions are a method of describing both simple and complex patterns for searching and
manipulating. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
15. Parentheses are not used to identify the sub expressions within the expression. True or False? Mark
for Review
(1) Points
True
False (*)
Section 17 Quiz
(Answer all questions in this section)
1. _________________ are special characters that have a special meaning, such as a wildcard character,
a repeating character, a non-matching character, or a range of characters. You can use several of these
symbols in pattern matching. Mark for Review
(1) Points
Alphanumeric values
Reference checks
Clip Art
Correct Correct
2. Regular expressions are a method of describing both simple and complex patterns for searching and
manipulating. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
3. Parentheses are not used to identify the sub expressions within the expression. True or False? Mark
for Review
(1) Points
True
False (*)
Correct Correct
UPDATE
INDEX
Correct Correct
5. You want to grant user BOB the ability to change other users' passwords. Which privilege should you
grant to BOB? Mark for Review
(1) Points
The CREATE PROFILE privilege
Section 17 Quiz
(Answer all questions in this section)
6. 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
ALTER TABLE
None; users do not need extra privileges to create indexes on tables in their own schema. (*)
Correct Correct
7. You create a view named EMPLOYEES_VIEW on a subset of the EMPLOYEES table. User
AUDREY needs to use this view to create reports. Only you and Audrey should have access to this view.
Which of the following actions should you perform? Mark for Review
(1) Points
Do nothing. As a database user, Audrey's user account has automatically been granted the SELECT
privilege for all database objects.
Correct Correct
8. User SUSAN creates an EMPLOYEES table, and then creates a view EMP_VIEW which shows only
the FIRST_NAME and LAST_NAME columns of EMPLOYEES. User RUDI needs to be able to access
employees' names but no other data from EMPLOYEES. Which statement should SUSAN execute to
allow this? Mark for Review
(1) Points
Correct Correct
9. The database administrator wants to allow user Marco to create new tables in his own schema. Which
privilege should be granted to Marco? Mark for Review
(1) Points
SELECT
CREATE ANY TABLE
CREATE OBJECT
10. To join a table in your database to a table on a second (remote) Oracle database, you need to use:
Mark for Review
(1) Points
An ODBC driver
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
11. 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 (*)
12. User1 owns a table and grants select on it WITH GRANT OPTION to User2. User2 then grants
select on the same table to User3. If User1 revokes select privileges from User2, will User3 be able to
access the table? Mark for Review
(1) Points
Yes
No (*)
Correct Correct
13. To take away a privilege from a user, you use which command? Mark for Review
(1) Points
ALTER
DELETE
REMOVE
REVOKE (*)
Correct Correct
14. Which statement would you use to grant a role to users? Mark for Review
(1) Points
ASSIGN
GRANT (*)
ALTER USER
CREATE USER
Correct Correct
15. Which keyword would you use to grant an object privilege to all database users? Mark for Review
(1) Points
ALL
ADMIN
PUBLIC (*)
USERS
Section 17 Quiz
(Answer all questions in this section)
1. Which data dictionary view shows which system privileges have been granted to a user? Mark for
Review
(1) Points
USER_SYSTEM_PRIVILEGES
USER_SYSTEM_PRIVS
USER_SYS_PRIVS (*)
USER_TAB_PRIVS
Correct Correct
2. Which statement would you use to remove an object privilege granted to a user? Mark for Review
(1) Points
DROP
REMOVE
REVOKE (*)
ALTER USER
Correct Correct
3. Which keyword would you use to grant an object privilege to all database users? Mark for Review
(1) Points
ADMIN
USERS
ALL
PUBLIC (*)
Correct Correct
4. You need to grant user BOB SELECT privileges on the EMPLOYEES table. You want to allow
BOB to grant this privileges to other users. Which statement should you use? Mark for Review
(1) Points
Correct Correct
5. To take away a privilege from a user, you use which command? Mark for Review
(1) Points
REMOVE
DELETE
REVOKE (*)
ALTER
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
6. 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 INVENTORY_V view. (*)
He must grant each user the SELECT privilege on both the INVENTORY table and INVENTORY_V
view.
He is not required to take any action because, by default, all database users can automatically access
views.
He should assign the SELECT privilege to all database users for the INVENTORY table.
7. Which of the following are object privileges? (Choose two) Mark for Review
(1) Points
CREATE TABLE
INSERT (*)
SELECT (*)
DROP TABLE
8. Which of the following Object Privileges can be granted on an individual column on a table? (Choose
two) Mark for Review
(1) Points
Delete
Select
Update (*)
Correct Correct
9. You are the database administrator. You want to create a new user JONES with a password of
MARK, and allow this user to create his own tables. Which of the following should you execute? Mark
for Review
(1) Points
Correct Correct
10. 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.
Correct Correct
Section 17 Quiz
(Answer all questions in this section)
11. 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
12. You want to grant user BOB the ability to change other users' passwords. Which privilege should
you grant to BOB? Mark for Review
(1) Points
Correct Correct
13. REGULAR EXPRESSIONS can be used on CHAR, CLOB, and VARCHAR2 datatypes? (True or
False) Mark for Review
(1) Points
True (*)
False
Correct Correct
14. Which of these SQL functions used to manipulate strings is NOT a valid regular expression function
? Mark for Review
(1) Points
REGEXP_REPLACE
REGEXP (*)
REGEXP_SUBSTR
REGEXP_LIKE
Correct Correct
15. Select the correct REGULAR EXPRESSION functions: (Choose two) Mark for Review
(1) Points
REGEXP_REPLACE, REGEXP_REFORM
REGEXP_LIKE, REGEXP_NEAR
Correct Correct
ASSIGN
ALTER ROLE
CREATE ROLE
Correct
A schema is: